// Implement if required
}
-void DummyVisual::OnDoAction( const Property::Index actionName, const Property::Value attributes )
+void DummyVisual::OnDoAction( const Property::Index actionName, const Property::Value& attributes )
{
if ( DummyVisual::TEST_ACTION == actionName )
{
virtual void DoSetProperties( const Property::Map& propertyMap ) override;
virtual void OnSetTransform() override;
virtual void DoSetOnStage( Actor& actor ) override;
- virtual void OnDoAction( const Property::Index actionName, const Property::Value attributes );
+ virtual void OnDoAction( const Property::Index actionName, const Property::Value& attributes ) override;
private:
unsigned int mActionCounter;
SamplingMode::BOX_THEN_LINEAR,
TextureManager::NO_ATLAS,
&observer,
- true );
+ true,
+ TextureManager::ReloadPolicy::CACHED );
const VisualUrl& url = textureManager.GetVisualUrl( textureId );
#include <dali-toolkit/public-api/align-enumerations.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-actions-devel.h>
+
+
#include <toolkit-event-thread-callback.h>
#include "dummy-control.h"
END_TEST;
}
+
+int UtcDaliControlDoAction(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "DoAction on a visual registered with a control" );
+
+ // Set up trace debug
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable( true );
+
+ //Created AnimatedImageVisual
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions() );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
+ dummyControl.SetSize(200.f, 200.f);
+ Stage::GetCurrent().Add( dummyControl );
+
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ textureTrace.Reset();
+
+ Property::Map attributes;
+ DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes );
+
+ tet_infoline( "Perform RELOAD action. should reload Image and generate a texture" );
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliControlDoActionWhenNotStage(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "DoAction on a visual registered with a control but not staged" );
+
+ // Set up trace debug
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable( true );
+
+ //Created AnimatedImageVisual
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions() );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
+ dummyControl.SetSize(200.f, 200.f);
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
+ textureTrace.Reset();
+
+ Property::Map attributes;
+ DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes );
+
+ tet_infoline( "Perform RELOAD action. should reload Image and generate a texture" );
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ textureTrace.Reset();
+
+ tet_infoline( "Adding control to stage will in turn add the visual to the stage" );
+
+ Stage::GetCurrent().Add( dummyControl );
+ application.SendNotification();
+ application.Render();
+ tet_infoline( "No change in textures could occurs as already loaded and cached texture will be used" );
+
+ DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
+ textureTrace.Reset();
+
+ END_TEST;
+}
const int KEY_A_CODE = 38;
const int KEY_D_CODE = 40;
+const int KEY_C_CODE = 54;
+const int KEY_V_CODE = 55;
+const int KEY_X_CODE = 53;
const int KEY_WHITE_SPACE_CODE = 65;
+const int KEY_SHIFT_MODIFIER = 257;
+const int KEY_CONTROL_MODIFIER = 258;
+
const char* HANDLE_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insertpoint-icon.png";
const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
application.SendNotification();
application.Render();
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
+
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int utcDaliTextEditorEvent07(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorEvent07");
+
+ // Checks if the highlight actor is created.
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ Stage::GetCurrent().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
+ editor.SetSize( 100.f, 50.f );
+ editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+ // 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
+ application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+ application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Move to second line of the text.
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Select some text in the right of the current cursor position
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Cut the selected text
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( "Hello\nld\nHello world", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
+
+ // Select some text in the left of the current cursor position
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Copy the selected text
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Move the cursor to the third line
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Paste the selected text at the current cursor position
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "v", "v", KEY_V_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( "Hello\nld\nHello lo\nworld", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
+
END_TEST;
}
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
+#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
using namespace Dali;
using namespace Toolkit;
END_TEST;
}
+
+int UtcDaliToolkitTextlabelMultiline(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelMultiline");
+
+ TextLabel label = TextLabel::New();
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world Hello world Hello world" );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
+ label.SetProperty( TextLabel::Property::MULTI_LINE, false );
+ Stage::GetCurrent().Add( label );
+
+ application.SendNotification();
+ application.Render();
+
+ int lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( lineCount, 1, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+
+ application.SendNotification();
+ application.Render();
+
+ lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( true, (lineCount > 1) , TEST_LOCATION );
+
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextlabelTextDirection(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelTextDirection");
+
+ TextLabel label = TextLabel::New();
+ label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
+ Stage::GetCurrent().Add( label );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::TEXT, "ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ END_TEST;
+}
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
+#define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelTextLabel
+{
+
+namespace Property
+{
+ enum Type
+ {
+ RENDERING_BACKEND = Dali::Toolkit::TextLabel::Property::RENDERING_BACKEND,
+ TEXT = Dali::Toolkit::TextLabel::Property::TEXT,
+ FONT_FAMILY = Dali::Toolkit::TextLabel::Property::FONT_FAMILY,
+ FONT_STYLE = Dali::Toolkit::TextLabel::Property::FONT_STYLE,
+ POINT_SIZE = Dali::Toolkit::TextLabel::Property::POINT_SIZE,
+ MULTI_LINE = Dali::Toolkit::TextLabel::Property::MULTI_LINE,
+ HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT,
+ VERTICAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT,
+ UNUSED_PROPERTY_TEXT_COLOR = Dali::Toolkit::TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR,
+ SHADOW_OFFSET = Dali::Toolkit::TextLabel::Property::SHADOW_OFFSET,
+ SHADOW_COLOR = Dali::Toolkit::TextLabel::Property::SHADOW_COLOR,
+ UNDERLINE_ENABLED = Dali::Toolkit::TextLabel::Property::UNDERLINE_ENABLED,
+ UNDERLINE_COLOR = Dali::Toolkit::TextLabel::Property::UNDERLINE_COLOR,
+ UNDERLINE_HEIGHT = Dali::Toolkit::TextLabel::Property::UNDERLINE_HEIGHT,
+ ENABLE_MARKUP = Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP,
+ ENABLE_AUTO_SCROLL = Dali::Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL,
+ AUTO_SCROLL_SPEED = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED,
+ AUTO_SCROLL_LOOP_COUNT = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT,
+ AUTO_SCROLL_GAP = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_GAP,
+ LINE_SPACING = Dali::Toolkit::TextLabel::Property::LINE_SPACING,
+ UNDERLINE = Dali::Toolkit::TextLabel::Property::UNDERLINE,
+ SHADOW = Dali::Toolkit::TextLabel::Property::SHADOW,
+ EMBOSS = Dali::Toolkit::TextLabel::Property::EMBOSS,
+ OUTLINE = Dali::Toolkit::TextLabel::Property::OUTLINE,
+ PIXEL_SIZE = Dali::Toolkit::TextLabel::Property::PIXEL_SIZE,
+ ELLIPSIS = Dali::Toolkit::TextLabel::Property::ELLIPSIS,
+ AUTO_SCROLL_LOOP_DELAY = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY,
+ AUTO_SCROLL_STOP_MODE = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE,
+ LINE_COUNT = Dali::Toolkit::TextLabel::Property::LINE_COUNT,
+ LINE_WRAP_MODE = Dali::Toolkit::TextLabel::Property::LINE_WRAP_MODE,
+
+ /**
+ * @brief The direction of the layout.
+ * @details Name "textDirection", type Property::Integer, Read-Only.
+ * @see TextDirection::Type for supported values.
+ */
+ TEXT_DIRECTION,
+ };
+
+} // namespace Property
+
+} // namespace DevelTextLabel
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
devel_api_visuals_header_files = \
$(devel_api_src_dir)/visuals/image-visual-properties-devel.h \
+ $(devel_api_src_dir)/visuals/image-visual-actions-devel.h \
$(devel_api_src_dir)/visuals/animated-gradient-visual-properties-devel.h \
$(devel_api_src_dir)/visuals/visual-properties-devel.h
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_ENUMERATIONS_DEVEL_H
+#define DALI_TOOLKIT_TEXT_ENUMERATIONS_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelText
+{
+
+namespace TextDirection
+{
+
+enum Type
+{
+ LEFT_TO_RIGHT,
+ RIGHT_TO_LEFT
+};
+
+} // namespace TextDirection
+
+} // namespace DevelText
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif //DALI_TOOLKIT_TEXT_ENUMERATIONS_DEVEL_H
--- /dev/null
+#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_ACTIONS_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_ACTIONS_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelImageVisual
+{
+
+/**
+ * @brief Actions that the image visual can perform. These actions are called through the Visual::Base::DoAction API.
+ */
+namespace Action
+{
+/**
+ * @brief The available actions for this visual
+ */
+enum Type
+{
+ RELOAD = 0, ///< Force reloading of the image, all visuals using this image will get the latest one.
+};
+
+} // namespace Actions
+
+} // namespace DevelImageVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_ACTIONS_DEVEL_H
if( !visualReplaced ) // New registration entry
{
- // monitor when the visual resources are ready
- StartObservingVisual( visual );
-
// If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
( mVisuals.Size() > 0 ) &&
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
+
using namespace Dali::Toolkit::Text;
namespace Dali
DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode", STRING, AUTO_SCROLL_STOP_MODE )
DALI_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount", INTEGER, LINE_COUNT )
DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineWrapMode", INTEGER, LINE_WRAP_MODE )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "textDirection", INTEGER, TEXT_DIRECTION )
DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, TextLabel, "textColor", Color::BLACK, TEXT_COLOR )
DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorRed", TEXT_COLOR_RED, TEXT_COLOR, 0 )
DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR, 1 )
}
break;
}
+ case Toolkit::DevelTextLabel::Property::TEXT_DIRECTION:
+ {
+ if( impl.mController )
+ {
+ value = impl.mController->GetTextDirection();
+ }
+ break;
+ }
}
}
}
int keyCode = event.p1.mInt;
+ bool isShiftModifier = event.p2.mBool;
+
+ CharacterIndex previousPrimaryCursorPosition = mEventData->mPrimaryCursorPosition;
if( Dali::DALI_KEY_CURSOR_LEFT == keyCode )
{
mEventData->mPrimaryCursorPosition = CalculateNewCursorIndex( mEventData->mPrimaryCursorPosition );
}
}
- else if( Dali::DALI_KEY_CURSOR_UP == keyCode )
+ else if( Dali::DALI_KEY_CURSOR_UP == keyCode && !isShiftModifier )
{
+ // Ignore Shift-Up for text selection for now.
+
// Get first the line index of the current cursor position index.
CharacterIndex characterIndex = 0u;
CharacterHitTest::TAP,
matchedCharacter );
}
- else if( Dali::DALI_KEY_CURSOR_DOWN == keyCode )
+ else if( Dali::DALI_KEY_CURSOR_DOWN == keyCode && !isShiftModifier )
{
+ // Ignore Shift-Down for text selection for now.
+
// Get first the line index of the current cursor position index.
CharacterIndex characterIndex = 0u;
}
}
- mEventData->mUpdateCursorPosition = true;
+ if ( !isShiftModifier && mEventData->mState != EventData::SELECTING )
+ {
+ // Update selection position after moving the cursor
+ mEventData->mLeftSelectionPosition = mEventData->mPrimaryCursorPosition;
+ mEventData->mRightSelectionPosition = mEventData->mPrimaryCursorPosition;
+ }
+
+ if ( isShiftModifier && IsShowingRealText() )
+ {
+ // Handle text selection
+ bool selecting = false;
+
+ if ( Dali::DALI_KEY_CURSOR_LEFT == keyCode || Dali::DALI_KEY_CURSOR_RIGHT == keyCode )
+ {
+ // Shift-Left/Right to select the text
+ int cursorPositionDelta = mEventData->mPrimaryCursorPosition - previousPrimaryCursorPosition;
+ if ( cursorPositionDelta > 0 || mEventData->mRightSelectionPosition > 0u ) // Check the boundary
+ {
+ mEventData->mRightSelectionPosition += cursorPositionDelta;
+ }
+ selecting = true;
+ }
+ else if ( mEventData->mLeftSelectionPosition != mEventData->mRightSelectionPosition )
+ {
+ // Show no grab handles and text highlight if Shift-Up/Down pressed but no selected text
+ selecting = true;
+ }
+
+ if ( selecting )
+ {
+ // Notify the cursor position to the imf manager.
+ if( mEventData->mImfManager )
+ {
+ mEventData->mImfManager.SetCursorPosition( mEventData->mPrimaryCursorPosition );
+ mEventData->mImfManager.NotifyCursorPosition();
+ }
+
+ ChangeState( EventData::SELECTING );
+
+ mEventData->mUpdateLeftSelectionPosition = true;
+ mEventData->mUpdateRightSelectionPosition = true;
+ mEventData->mUpdateGrabHandlePosition = true;
+ mEventData->mUpdateHighlightBox = true;
+
+ // Hide the text selection popup if select the text using keyboard instead of moving grab handles
+ if( mEventData->mGrabHandlePopupEnabled )
+ {
+ mEventData->mDecorator->SetPopupActive( false );
+ }
+ }
+ }
+ else
+ {
+ // Handle normal cursor move
+ ChangeState( EventData::EDITING );
+ mEventData->mUpdateCursorPosition = true;
+ }
+
mEventData->mUpdateInputStyle = true;
mEventData->mScrollAfterUpdatePosition = true;
}
mEventData->mPrimaryCursorPosition = 0u;
}
+ // Update selection position after tapping
+ mEventData->mLeftSelectionPosition = mEventData->mPrimaryCursorPosition;
+ mEventData->mRightSelectionPosition = mEventData->mPrimaryCursorPosition;
+
mEventData->mUpdateCursorPosition = true;
mEventData->mUpdateGrabHandlePosition = true;
mEventData->mScrollAfterUpdatePosition = true;
int mInt;
unsigned int mUint;
float mFloat;
+ bool mBool;
};
Event( Type eventType )
const std::string EMPTY_STRING("");
+const std::string KEY_C_NAME = "c";
+const std::string KEY_V_NAME = "v";
+const std::string KEY_X_NAME = "x";
+
const char * const PLACEHOLDER_TEXT = "text";
const char * const PLACEHOLDER_TEXT_FOCUSED = "textFocused";
const char * const PLACEHOLDER_COLOR = "color";
ALIGN |
REORDER );
+ mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | layoutOperations );
mImpl->RequestRelayout();
}
}
+Toolkit::DevelText::TextDirection::Type Controller::GetTextDirection()
+{
+ const LineRun* const firstline = mImpl->mModel->mVisualModel->mLines.Begin();
+ if ( firstline && firstline->direction )
+ {
+ return Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT;
+ }
+
+ return Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT;
+}
+
// public : Relayout.
Controller::UpdateTextType Controller::Relayout( const Size& size )
{
int keyCode = keyEvent.keyCode;
const std::string& keyString = keyEvent.keyPressed;
+ const std::string keyName = keyEvent.keyPressedName;
const bool isNullKey = ( 0 == keyCode ) && ( keyString.empty() );
mImpl->mEventData->mCheckScrollAmount = true;
Event event( Event::CURSOR_KEY_EVENT );
event.p1.mInt = keyCode;
+ event.p2.mBool = keyEvent.IsShiftModifier();
mImpl->mEventData->mEventQueue.push_back( event );
// Will request for relayout.
relayoutNeeded = true;
}
+ else if ( Dali::DevelKey::DALI_KEY_CONTROL_LEFT == keyCode || Dali::DevelKey::DALI_KEY_CONTROL_RIGHT == keyCode )
+ {
+ // Left or Right Control key event is received before Ctrl-C/V/X key event is received
+ // If not handle it here, any selected text will be deleted
+
+ // Do nothing
+ return false;
+ }
+ else if ( keyEvent.IsCtrlModifier() )
+ {
+ bool consumed = false;
+ if (keyName == KEY_C_NAME)
+ {
+ // Ctrl-C to copy the selected text
+ TextPopupButtonTouched( Toolkit::TextSelectionPopup::COPY );
+ consumed = true;
+ }
+ else if (keyName == KEY_V_NAME)
+ {
+ // Ctrl-V to paste the copied text
+ TextPopupButtonTouched( Toolkit::TextSelectionPopup::PASTE );
+ consumed = true;
+ }
+ else if (keyName == KEY_X_NAME)
+ {
+ // Ctrl-X to cut the selected text
+ TextPopupButtonTouched( Toolkit::TextSelectionPopup::CUT );
+ consumed = true;
+ }
+ return consumed;
+ }
else if( ( Dali::DALI_KEY_BACKSPACE == keyCode ) ||
( Dali::DevelKey::DALI_KEY_DELETE == keyCode ) )
{
{
// When the text is being modified, delay cursor blinking
mImpl->mEventData->mDecorator->DelayCursorBlink();
+
+ // Update selection position after modifying the text
+ mImpl->mEventData->mLeftSelectionPosition = mImpl->mEventData->mPrimaryCursorPosition;
+ mImpl->mEventData->mRightSelectionPosition = mImpl->mEventData->mPrimaryCursorPosition;
}
// Discard temporary text
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/text/text-enumerations.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
+#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
#include <dali-toolkit/internal/text/hidden-text.h>
*/
void GetPlaceholderProperty( Property::Map& map );
+ /**
+ * @brief Checks text direction.
+ * @return The text direction.
+ */
+ Toolkit::DevelText::TextDirection::Type GetTextDirection();
+
public: // Relayout.
/**
mImageUrls[ mUrlIndex ].mTextureId =
mTextureManager.RequestLoad( url, ImageDimensions(), FittingMode::SCALE_TO_FILL,
SamplingMode::BOX_THEN_LINEAR, TextureManager::NO_ATLAS,
- this, ENABLE_ORIENTATION_CORRECTION );
+ this, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED );
mRequestingLoad = false;
++mUrlIndex;
}
mImageUrls[ imageFrame.mUrlIndex ].mTextureId =
mTextureManager.RequestLoad( url, ImageDimensions(), FittingMode::SCALE_TO_FILL,
SamplingMode::BOX_THEN_LINEAR, TextureManager::NO_ATLAS,
- this, ENABLE_ORIENTATION_CORRECTION );
+ this, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED );
mRequestingLoad = false;
}
// INTERNAL HEADERS
#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-actions-devel.h>
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
}
}
}
-
// Load image immediately if LOAD_POLICY requires it
if ( mLoadPolicy == DevelImageVisual::LoadPolicy::IMMEDIATE )
{
- auto attemptAtlasing = mAttemptAtlasing;
- LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection );
+ auto attemptAtlasing = AttemptAtlasing();
+ LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection,
+ TextureManager::ReloadPolicy::CACHED );
}
}
return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
}
-void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& textures, bool orientationCorrection )
+void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& textures, bool orientationCorrection,
+ TextureManager::ReloadPolicy forceReload )
{
TextureManager& textureManager = mFactoryCache.GetTextureManager();
textures = textureManager.LoadTexture( mImageUrl, mDesiredSize, mFittingMode, mSamplingMode,
mMaskingData, IsSynchronousResourceLoading(), mTextureId,
atlasRect, atlasing, mLoading, mWrapModeU,
- mWrapModeV, textureObserver, atlasUploadObserver, atlasManager, mOrientationCorrection );
+ mWrapModeV, textureObserver, atlasUploadObserver, atlasManager,
+ mOrientationCorrection,
+ forceReload );
+
+ if( atlasing ) // Flag needs to be set before creating renderer
+ {
+ mImpl->mFlags |= Impl::IS_ATLASING_APPLIED;
+ }
+ else
+ {
+ mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
+ }
}
-void ImageVisual::InitializeRenderer()
+bool ImageVisual::AttemptAtlasing()
{
- auto attemptAtlasing = ( ! mImpl->mCustomShader && mImageUrl.GetProtocolType() == VisualUrl::LOCAL && mAttemptAtlasing );
+ return ( ! mImpl->mCustomShader && mImageUrl.GetProtocolType() == VisualUrl::LOCAL && mAttemptAtlasing );
+}
+void ImageVisual::InitializeRenderer()
+{
+ auto attemptAtlasing = AttemptAtlasing();
// texture set has to be created first as we need to know if atlasing succeeded or not
// when selecting the shader
if( mTextureId == TextureManager::INVALID_TEXTURE_ID && ! mTextures ) // Only load the texture once
{
- LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection );
- }
-
- if( attemptAtlasing ) // Flag needs to be set before creating renderer
- {
- mImpl->mFlags |= Impl::IS_ATLASING_APPLIED;
- }
- else
- {
- mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
+ LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection,
+ TextureManager::ReloadPolicy::CACHED );
}
CreateRenderer( mTextures );
}
}
+void ImageVisual::OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes )
+{
+ // Check if action is valid for this visual type and perform action if possible
+
+ switch ( actionName )
+ {
+ case DevelImageVisual::Action::RELOAD:
+ {
+ auto attemptAtlasing = AttemptAtlasing();
+ LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection,
+ TextureManager::ReloadPolicy::FORCED );
+ break;
+ }
+ }
+}
+
void ImageVisual::OnSetTransform()
{
if( mImpl->mRenderer )
// From existing atlas manager
void ImageVisual::UploadCompleted()
{
- // Texture has been uploaded. If weak handle is holding a placement actor, it is the time to add the renderer to actor.
+ // Texture has been uploaded. If weak handle is holding a placement actor,
+ // it is the time to add the renderer to actor.
Actor actor = mPlacementActor.GetHandle();
if( actor )
{
}
// From Texture Manager
-void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle )
+void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas,
+ const Vector4& atlasRectangle )
{
Toolkit::Visual::ResourceStatus resourceStatus;
Actor actor = mPlacementActor.GetHandle();
*/
virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+ /**
+ * @copydoc Visual::Base::OnDoAction
+ */
+ virtual void OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes ) override;
+
protected:
/**
/**
* @copydoc Visual::Base::DoSetOffStage
*/
- virtual void DoSetOffStage( Actor& actor );
+ virtual void DoSetOffStage( Actor& actor ) ;
/**
* @copydoc Visual::Base::OnSetTransform
*/
- virtual void OnSetTransform();
+ virtual void OnSetTransform() ;
/**
* @copydoc Visual::Base::IsResourceReady
* @param[out] atlasRect if atlasing is used this the texture area of the image in the atlas.
* @param[out] textures resulting texture set from the image loading.
* @param[in] orientationCorrection flag determines if orientation correction should be performed
+ * @param[in] forceReload flag determines if the texture should be reloaded from its source or use the cached texture.
+ */
+ void LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& textures, bool orientationCorrection, TextureManager::ReloadPolicy forceReload );
+
+ /**
+ * @brief Checks if atlasing should be attempted
+ * @return bool returns true if atlasing can be attempted.
*/
- void LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& textures, bool orientationCorrection );
+ bool AttemptAtlasing();
/**
* @brief Initializes the Dali::Renderer from the image url
bool synchronousLoading, TextureManager::TextureId& textureId, Vector4& textureRect,
bool& atlasingStatus, bool& loadingStatus, Dali::WrapMode::Type wrapModeU,
Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver,
- AtlasUploadObserver* atlasObserver, ImageAtlasManagerPtr imageAtlasManager, bool orientationCorrection )
+ AtlasUploadObserver* atlasObserver, ImageAtlasManagerPtr imageAtlasManager, bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy )
{
TextureSet textureSet;
PixelData data;
if( url.IsValid() )
{
- Devel::PixelBuffer pixelBuffer = LoadImageFromFile( url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection );
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile( url.GetUrl(), desiredSize, fittingMode, samplingMode,
+ orientationCorrection );
if( pixelBuffer )
{
data = Devel::PixelBuffer::Convert(pixelBuffer); // takes ownership of buffer
atlasingStatus = false;
if( !maskInfo )
{
- textureId = RequestLoad( url, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, textureObserver, orientationCorrection );
+ textureId = RequestLoad( url, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS,
+ textureObserver, orientationCorrection, reloadPolicy );
}
else
{
TextureManager::NO_ATLAS,
maskInfo->mCropToMask,
textureObserver,
- orientationCorrection);
+ orientationCorrection,
+ reloadPolicy );
}
TextureManager::LoadState loadState = GetTextureState( textureId );
}
TextureManager::TextureId TextureManager::RequestLoad(
- const VisualUrl& url,
- const ImageDimensions desiredSize,
- FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode,
- const UseAtlas useAtlas,
- TextureUploadObserver* observer,
- bool orientationCorrection )
+ const VisualUrl& url,
+ const ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ Dali::SamplingMode::Type samplingMode,
+ const UseAtlas useAtlas,
+ TextureUploadObserver* observer,
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy )
{
- return RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, useAtlas, false, UPLOAD_TO_TEXTURE, observer, orientationCorrection );
+ return RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, useAtlas,
+ false, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy );
}
TextureManager::TextureId TextureManager::RequestLoad(
- const VisualUrl& url,
- TextureId maskTextureId,
- float contentScale,
- const ImageDimensions desiredSize,
- FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode,
- const UseAtlas useAtlas,
- bool cropToMask,
- TextureUploadObserver* observer,
- bool orientationCorrection )
-{
- return RequestLoadInternal( url, maskTextureId, contentScale, desiredSize, fittingMode, samplingMode, useAtlas, cropToMask, UPLOAD_TO_TEXTURE, observer, orientationCorrection );
+ const VisualUrl& url,
+ TextureId maskTextureId,
+ float contentScale,
+ const ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ Dali::SamplingMode::Type samplingMode,
+ const UseAtlas useAtlas,
+ bool cropToMask,
+ TextureUploadObserver* observer,
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy )
+{
+ return RequestLoadInternal( url, maskTextureId, contentScale, desiredSize, fittingMode, samplingMode, useAtlas,
+ cropToMask, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy );
}
TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& maskUrl )
{
// Use the normal load procedure to get the alpha mask.
- return RequestLoadInternal( maskUrl, INVALID_TEXTURE_ID, 1.0f, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, false, KEEP_PIXEL_BUFFER, NULL, true );
+ return RequestLoadInternal( maskUrl, INVALID_TEXTURE_ID, 1.0f, ImageDimensions(), FittingMode::SCALE_TO_FILL,
+ SamplingMode::NO_FILTER, NO_ATLAS, false, KEEP_PIXEL_BUFFER, NULL, true,
+ TextureManager::ReloadPolicy::CACHED );
}
TextureManager::TextureId TextureManager::RequestLoadInternal(
- const VisualUrl& url,
- TextureId maskTextureId,
- float contentScale,
- const ImageDimensions desiredSize,
- FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode,
- UseAtlas useAtlas,
- bool cropToMask,
- StorageType storageType,
- TextureUploadObserver* observer,
- bool orientationCorrection )
+ const VisualUrl& url,
+ TextureId maskTextureId,
+ float contentScale,
+ const ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ Dali::SamplingMode::Type samplingMode,
+ UseAtlas useAtlas,
+ bool cropToMask,
+ StorageType storageType,
+ TextureUploadObserver* observer,
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy )
{
// First check if the requested Texture is cached.
- const TextureHash textureHash = GenerateHash( url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId );
+ const TextureHash textureHash = GenerateHash( url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas,
+ maskTextureId );
TextureManager::TextureId textureId = INVALID_TEXTURE_ID;
// Look up the texture by hash. Note: The extra parameters are used in case of a hash collision.
- int cacheIndex = FindCachedTexture( textureHash, url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId );
+ int cacheIndex = FindCachedTexture( textureHash, url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas,
+ maskTextureId );
// Check if the requested Texture exists in the cache.
if( cacheIndex != INVALID_CACHE_INDEX )
{
- // Mark this texture being used by another client resource.
- ++( mTextureInfoContainer[ cacheIndex ].referenceCount );
+ if ( TextureManager::ReloadPolicy::CACHED == reloadPolicy )
+ {
+ // Mark this texture being used by another client resource. Forced reload would replace the current texture
+ // without the need for incrementing the reference count.
+ ++( mTextureInfoContainer[ cacheIndex ].referenceCount );
+ }
textureId = mTextureInfoContainer[ cacheIndex ].textureId;
-
- DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::RequestLoad( url=%s observer=%p ) Using cached texture @%d, textureId=%d\n", url.GetUrl().c_str(), observer, cacheIndex, textureId );
+ DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::RequestLoad( url=%s observer=%p ) Using cached texture id@%d, textureId=%d\n",
+ url.GetUrl().c_str(), observer, cacheIndex, textureId );
}
if( textureId == INVALID_TEXTURE_ID ) // There was no caching, or caching not required
false, cropToMask, useAtlas, textureHash, orientationCorrection ) );
cacheIndex = mTextureInfoContainer.size() - 1u;
- DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d\n", url.GetUrl().c_str(), observer, cacheIndex, textureId );
+ DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d\n",
+ url.GetUrl().c_str(), observer, cacheIndex, textureId );
}
// The below code path is common whether we are using the cache or not.
textureInfo.loadState == TextureManager::UPLOADED ? "UPLOADED" :
textureInfo.loadState == TextureManager::CANCELLED ? "CANCELLED" : "Unknown" );
- // Check if we should add the observer. Only do this if we have not loaded yet and it will not have loaded by the end of this method.
+ // Force reloading of texture by setting loadState unless already loading or cancelled.
+ if ( TextureManager::ReloadPolicy::FORCED == reloadPolicy && TextureManager::LOADING != textureInfo.loadState &&
+ TextureManager::CANCELLED != textureInfo.loadState )
+ {
+ DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Verbose, "TextureManager::RequestLoad( url=%s observer=%p ) ForcedReload cacheIndex:%d, textureId=%d\n",
+ url.GetUrl().c_str(), observer, cacheIndex, textureId );
+ textureInfo.loadState = TextureManager::NOT_STARTED;
+ }
+
+ // Check if we should add the observer.
+ // Only do this if we have not loaded yet and it will not have loaded by the end of this method.
switch( textureInfo.loadState )
{
+ case TextureManager::LOAD_FAILED: // Failed notifies observer which then stops observing.
case TextureManager::NOT_STARTED:
{
LoadTexture( textureInfo );
}
case TextureManager::LOAD_FINISHED:
case TextureManager::WAITING_FOR_MASK:
- case TextureManager::LOAD_FAILED:
// Loading has already completed. Do nothing.
break;
}
}
}
-void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id, Devel::PixelBuffer pixelBuffer )
+void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id,
+ Devel::PixelBuffer pixelBuffer )
{
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::AsyncLoadComplete( id:%d )\n", id );
{
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, " TextureManager::UploadTexture() New Texture for textureId:%d\n", textureInfo.textureId );
- Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+ Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(),
+ pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
texture.Upload( pixelData );
- textureInfo.textureSet = TextureSet::New();
+ if ( ! textureInfo.textureSet )
+ {
+ textureInfo.textureSet = TextureSet::New();
+ }
textureInfo.textureSet.SetTexture( 0u, texture );
}
for( unsigned int i = 0; i < count; ++i )
{
TextureInfo& textureInfo( mTextureInfoContainer[i] );
- for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin(); j != textureInfo.observerList.End(); )
+ for( TextureInfo::ObserverListType::Iterator j = textureInfo.observerList.Begin();
+ j != textureInfo.observerList.End(); )
{
if( *j == observer )
{
LOAD_FAILED ///< Async loading failed, e.g. connection problem
};
+ /**
+ * @breif Types of reloading policies
+ */
+ enum class ReloadPolicy
+ {
+ CACHED = 0, ///< Loads cached texture if it exists.
+ FORCED ///< Forces reloading of texture.
+ };
+
public:
struct MaskingData
Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver,
AtlasUploadObserver* atlasObserver,
ImageAtlasManagerPtr imageAtlasManager,
- bool orientationCorrection );
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy );
/**
* @brief Requests an image load of the given URL.
* @param[in] observer The client object should inherit from this and provide the "UploadCompleted" virtual.
* This is called when an image load completes (or fails).
* @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
+ * @param[in] reloadPolicy Forces a reload of the texture even if already cached
* @return A TextureId to use as a handle to reference this Texture
*/
- TextureId RequestLoad( const VisualUrl& url,
- const ImageDimensions desiredSize,
- FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode,
- const UseAtlas useAtlasing,
- TextureUploadObserver* observer,
- bool orientationCorrection );
+ TextureId RequestLoad( const VisualUrl& url,
+ const ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ Dali::SamplingMode::Type samplingMode,
+ const UseAtlas useAtlasing,
+ TextureUploadObserver* observer,
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy );
/**
* @brief Requests an image load of the given URL, when the texture has
* When the client has finished with the Texture, Remove() should be called.
*
* @param[in] url The URL of the image to load
- * @param[in] maskTextureId The texture id of an image to mask this with (can be INVALID if no masking required)
+ * @param[in] maskTextureId The texture id of an image to mask this with
+ * (can be INVALID if no masking required)
* @param[in] contentScale The scale factor to apply to the image before masking
* @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
* @param[in] fittingMode The FittingMode to use
* @param[in] samplingMode The SamplingMode to use
- * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still be loaded, and marked successful,
- * but "useAtlasing" will be set to false in the "UploadCompleted" callback from the TextureManagerUploadObserver.
- * @param[in] cropToMask Only used with masking, this will crop the scaled image to the mask size. If false, then the mask will be scaled to fit the image before being applied.
- * @param[in] observer The client object should inherit from this and provide the "UploadCompleted" virtual.
+ * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still
+ * be loaded, and marked successful,
+ * but "useAtlasing" will be set to false in the "UploadCompleted" callback from
+ * the TextureManagerUploadObserver.
+ * @param[in] cropToMask Only used with masking, this will crop the scaled image to the mask size.
+ * If false, then the mask will be scaled to fit the image before being applied.
+ * @param[in] observer The client object should inherit from this and provide the "UploadCompleted"
+ * virtual.
* This is called when an image load completes (or fails).
* @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
+ * @param[in] reloadPolicy Forces a reload of the texture even if already cached
* @return A TextureId to use as a handle to reference this Texture
*/
- TextureId RequestLoad( const VisualUrl& url,
- TextureId maskTextureId,
- float contentScale,
- const ImageDimensions desiredSize,
- FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode,
- const UseAtlas useAtlasing,
- bool cropToMask,
- TextureUploadObserver* observer,
- bool orientationCorrection );
+ TextureId RequestLoad( const VisualUrl& url,
+ TextureId maskTextureId,
+ float contentScale,
+ const ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ Dali::SamplingMode::Type samplingMode,
+ const UseAtlas useAtlasing,
+ bool cropToMask,
+ TextureUploadObserver* observer,
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy );
/**
* Requests a masking image to be loaded. This mask is not uploaded to GL,
* When the client has finished with the Texture, Remove() should be called.
*
* @param[in] url The URL of the image to load
- * @param[in] maskTextureId The texture id of an image to use as a mask. If no mask is required, then set to INVALID_TEXTURE_ID
+ * @param[in] maskTextureId The texture id of an image to use as a mask. If no mask is required, then set
+ * to INVALID_TEXTURE_ID
* @param[in] contentScale The scaling factor to apply to the content when masking
* @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
* @param[in] fittingMode The FittingMode to use
* @param[in] samplingMode The SamplingMode to use
- * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still be loaded, and marked successful,
- * but "useAtlasing" will be set to false in the "UploadCompleted" callback from the TextureManagerUploadObserver.
- * @param[in] cropToMask Whether to crop the target after masking, or scale the mask to the image before masking.
+ * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still be
+ * loaded, and marked successful, but "useAtlasing" will be set to false in the
+ * "UploadCompleted" callback from the TextureManagerUploadObserver.
+ * @param[in] cropToMask Whether to crop the target after masking, or scale the mask to the image before
+ * masking.
* @param[in] storageType, Whether the pixel data is stored in the cache or uploaded to the GPU
- * @param[in] observer The client object should inherit from this and provide the "UploadCompleted" virtual.
+ * @param[in] observer The client object should inherit from this and provide the "UploadCompleted"
+ * virtual.
* This is called when an image load completes (or fails).
* @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
+ * @param[in] reloadPolicy Forces a reload of the texture even if already cached
* @return A TextureId to use as a handle to reference this Texture
*/
TextureId RequestLoadInternal(
- const VisualUrl& url,
- TextureId maskTextureId,
- float contentScale,
- const ImageDimensions desiredSize,
- FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode,
- UseAtlas useAtlas,
- bool cropToMask,
- StorageType storageType,
- TextureUploadObserver* observer,
- bool orientationCorrection );
+ const VisualUrl& url,
+ TextureId maskTextureId,
+ float contentScale,
+ const ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ Dali::SamplingMode::Type samplingMode,
+ UseAtlas useAtlas,
+ bool cropToMask,
+ StorageType storageType,
+ TextureUploadObserver* observer,
+ bool orientationCorrection,
+ TextureManager::ReloadPolicy reloadPolicy );
typedef size_t TextureHash; ///< The type used to store the hash used for Texture caching.
Dali::SamplingMode::Type samplingMode:3; ///< The requested SamplingMode
StorageType storageType:1; ///< CPU storage / GPU upload;
bool loadSynchronously:1; ///< True if synchronous loading was requested
- UseAtlas useAtlas:1; ///< USE_ATLAS if an atlas was requested. This is updated to false if atlas is not used
+ UseAtlas useAtlas:1; ///< USE_ATLAS if an atlas was requested.
+ ///< This is updated to false if atlas is not used
bool cropToMask:1; ///< true if the image should be cropped to the mask size.
bool orientationCorrection:1; ///< true if the image should be rotated to match exif orientation data
};
}
TextureId textureId; ///< The external Texture Id assigned to this load
- unsigned short loadId; ///< The load Id used by the async loader to reference this load
+ uint32_t loadId; ///< The load Id used by the async loader to reference this load
};
// Private typedefs:
* @brief Load a new texture.
* @param[in] textureId TextureId to reference the texture that will be loaded
* @param[in] url The URL of the image to load
- * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
+ * @param[in] desiredSize The size the image is likely to appear at.
+ * This can be set to 0,0 for automatic
* @param[in] fittingMode The FittingMode to use
* @param[in] samplingMode The SamplingMode to use
- * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image, e.g., from portrait to landscape
+ * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image,
+ * e.g., from portrait to landscape
*/
void Load(TextureId textureId,
const VisualUrl& url,
return mImpl->mFlags & Impl::IS_ON_STAGE;
}
-void Visual::Base::OnDoAction( const Property::Index actionId, const Property::Value attributes )
+void Visual::Base::OnDoAction( const Property::Index actionId, const Property::Value& attributes )
{
// May be overriden by derived class
}
* @param[in] actionId The action to perform
* @param[in] attributes The list of attributes for the action. ( optional for this data structure to have content )
*/
- virtual void OnDoAction( const Property::Index actionId, const Property::Value attributes );
+ virtual void OnDoAction( const Property::Index actionId, const Property::Value& attributes );
protected:
newChildSize.width = size.width - ( padding.start + padding.end );
newChildSize.height = size.height - ( padding.top + padding.bottom );
- Vector3 childPosition = child.GetTargetSize();
- childPosition.x += ( mImpl->mMargin.start + padding.start );
- childPosition.y += ( mImpl->mMargin.top + padding.top );
+ // Cannot use childs Position property as it can already have padding and margin applied on it,
+ // so we end up cumulatively applying them over and over again.
+ Vector2 childOffset( 0.f, 0.f );
+ childOffset.x += ( mImpl->mMargin.start + padding.start );
+ childOffset.y += ( mImpl->mMargin.top + padding.top );
- child.SetPosition( childPosition );
+ child.SetPosition( childOffset.x, childOffset.y );
}
container.Add( child, newChildSize );
* @endcode
*
* @SINCE_1_2.60
+ * @return The signal to connect to
* @note A RelayoutRequest is queued by Control before this signal is emitted
*/
ResourceReadySignalType& ResourceReadySignal();
};
/**
- * @brief An enumeration of properties belonging to the ProgressBar class.
+ * @brief Enumeration of properties belonging to the ProgressBar class.
* @SINCE_1_2.60
*/
struct Property
{
+ /**
+ * @brief Enumeration for the instance of properties belonging to the ProgressBar class.
+ * @SINCE_1_2.60
+ */
enum
{
/**
*
* Creates another handle that points to the same real object.
* @SINCE_1_2.60
+ * @param[in] handle Handle to an object
*/
ProgressBar( const ProgressBar& handle );
*
* Changes this handle to point to another real object.
* @SINCE_1_2.60
+ * @param[in] handle Handle to an object
+ * @return A reference to this
*/
ProgressBar& operator=( const ProgressBar& handle );
{
/**
- * @brief BorderVisual Property
+ * @brief BorderVisual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief BorderVisual Property
+ * @brief Enumeration for the instance of properties belonging to the BorderVisual.
* @SINCE_1_1.45
*/
enum
{
/**
- * @brief ColorVisual Property
+ * @brief ColorVisual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief ColorVisual Property
+ * @brief Enumeration for the instance of properties belonging to the ColorVisual.
* @SINCE_1_1.45
*/
enum
{
/**
- * @brief GradientVisual Property
+ * @brief GradientVisual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief GradientVisual Property
+ * @brief Enumeration for the instance of properties belonging to the GradientVisual.
* @SINCE_1_1.45
*/
enum
{
/**
- * @brief ImageVisual Property
+ * @brief ImageVisual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief ImageVisual Property
+ * @brief Enumeration for the instance of properties belonging to the ImageVisual.
* @SINCE_1_1.45
*/
enum
{
/**
- * @brief MeshVisual Property
+ * @brief MeshVisual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief MeshVisual Property
+ * @brief Enumeration for the instance of properties belonging to the MeshVisual.
* @SINCE_1_1.45
*/
enum
{
/**
- * @brief PrimitiveVisual Property
+ * @brief PrimitiveVisual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief PrimitiveVisual Property
+ * @brief Enumeration for the instance of properties belonging to the PrimitiveVisual.
* @SINCE_1_1.45
*/
enum
*/
/**
- * @brief TextVisual Properties
+ * @brief TextVisual is to render a text.
* @SINCE_1_2.60
*/
namespace TextVisual
{
+/**
+ * @brief TextVisual Property.
+ * @SINCE_1_2.60
+ */
namespace Property
{
+/**
+ * @brief Enumeration for the instance of properties belonging to the TextVisual.
+ * @SINCE_1_2.60
+ */
enum
{
/**
*/
/**
- * @brief All the visual types
+ * @brief All the visual types.
* @SINCE_1_1.45
*/
namespace Visual
};
/**
- * @brief Visual Property
+ * @brief Visual Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief Visual Property
+ * @brief Enumeration for the instance of properties belonging to the Visual Property.
* @SINCE_1_1.45
*/
enum
} // namespace Property
+/**
+ * @brief Visual Transfrom for the offset or size.
+ * @SINCE_1_2.60
+ */
namespace Transform
{
/**
* @brief Policies used by the transform for the offset or size.
* @SINCE_1_2.60
- *
*/
namespace Policy
{
+/**
+ * @brief Enumeration for the type of Transform Policy.
+ * @SINCE_1_2.60
+ */
enum Type
{
- RELATIVE = 0, ///< Relative to the control (percentage [0.0f to 1.0f] of the control).
- ABSOLUTE = 1 ///< Absolute value in world units.
+ RELATIVE = 0, ///< Relative to the control (percentage [0.0f to 1.0f] of the control). @SINCE_1_2.60
+ ABSOLUTE = 1 ///< Absolute value in world units. @SINCE_1_2.60
};
} // namespace Policy
+/**
+ * @brief Visual Transform Property.
+ * @SINCE_1_2.60
+ */
namespace Property
{
+/**
+ * @brief Enumeration for the type of Transfrom Property.
+ * @SINCE_1_2.60
+ */
enum Type
{
/**
} // namespace Transform
/**
- * @brief Shader for Visuals
+ * @brief Shader for Visuals.
* @SINCE_1_1.45
*/
namespace Shader
{
/**
- * @brief Shader Property
+ * @brief Shader Property.
* @SINCE_1_1.45
*/
namespace Property
{
/**
- * @brief The type of Shader
+ * @brief The type of Shader.
* @SINCE_1_1.45
*/
enum
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * This file is part of Dali Toolkit
+ *
+ * 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.
+ */
+
+
+//******************************************************************************
+//
+// Default Reference style theme for a 480x800 resolution, The values determined by UX design specification.
+// This file can be copied to a new folder within the styles/ directory and amended with new default values.
+// Can be overriden if StyleManager applies another style sheet.
+//
+//******************************************************************************
+
+{
+ "config":
+ {
+ "alwaysShowFocus":false,
+ "clearFocusOnEscape":true
+ },
+ "styles":
+ {
+ "TextLabel":
+ {
+ "pointSize":18,
+ "enableAutoScroll":false,
+ "autoScrollLoopCount":2,
+ "autoScrollGap":50,
+ "autoScrollSpeed":80
+ },
+
+ "TextLabelFontSize0":
+ {
+ "pointSize":8
+ },
+ "TextLabelFontSize1":
+ {
+ "pointSize":10
+ },
+ "TextLabelFontSize2":
+ {
+ "pointSize":15
+ },
+ "TextLabelFontSize3":
+ {
+ "pointSize":19
+ },
+ "TextLabelFontSize4":
+ {
+ "pointSize":25
+ },
+ "TextField":
+ {
+ "pointSize":18,
+ "primaryCursorColor":[0.0,0.72,0.9,1.0],
+ "secondaryCursorColor":[0.0,0.72,0.9,1.0],
+ "cursorWidth":3,
+ "selectionHighlightColor":[0.75,0.96,1.0,1.0],
+ "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
+ "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
+ "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
+ "enableSelection":true
+ },
+
+ "TextFieldFontSize0":
+ {
+ "pointSize":10
+ },
+ "TextFieldFontSize1":
+ {
+ "pointSize":10
+ },
+ "TextFieldFontSize2":
+ {
+ "pointSize":10
+ },
+ "TextFieldFontSize3":
+ {
+ "pointSize":10
+ },
+ "TextFieldFontSize4":
+ {
+ "pointSize":10
+ },
+ "TextSelectionPopup":
+ {
+ "popupMaxSize":[656,72],
+ "optionDividerSize":[2,0],
+ "popupDividerColor":[0.23,0.72,0.8,0.11],
+ "popupIconColor":[1.0,1.0,1.0,1.0],
+ "popupPressedColor":[0.24,0.72,0.8,0.11],
+ "background": {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}selection-popup-background.9.png"
+ },
+ "backgroundBorder": {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}selection-popup-border.9.png",
+ "mixColor":[0.24,0.72,0.8,1.0]
+ },
+ "popupFadeInDuration":0.25,
+ "popupFadeOutDuration":0.25
+ },
+ "TextSelectionPopupButton":
+ {
+ "label":
+ {
+ "visualType":"TEXT",
+ "pointSize":8
+ },
+ "unselectedBackgroundVisual":
+ {
+ "visualType": "IMAGE",
+ "url": ""
+ },
+ "selectedBackgroundVisual":
+ {
+ "visualType": "IMAGE",
+ "url": ""
+ }
+ },
+ "TextSelectionToolbar":
+ {
+ "enableOvershoot":true,
+ "enableScrollBar":true,
+ "scrollView":
+ {
+ "overshootAnimationSpeed":360.0,
+ "overshootSize":[720.0,130.0]
+ }
+ },
+ "TextSelectionScrollBar":
+ {
+ "indicatorShowDuration":0.25,
+ "indicatorHideDuration":0.25,
+ "indicatorTransientDuration":1.0
+ },
+ "TextSelectionScrollIndicator":
+ {
+ "image":
+ {
+ "visualType":"IMAGE",
+ "url":"{DALI_IMAGE_DIR}text_selection_scroll_indicator.9.png"
+ },
+ "color":[0.0,0.72,0.9,0.7]
+ },
+ "ScrollView":
+ {
+ "overshootEffectColor":"B018",
+ "overshootAnimationSpeed":360.0,
+ "overshootSize":[720.0,130.0]
+ },
+ "ItemView":
+ {
+ "overshootEffectColor":"B018",
+ "overshootAnimationSpeed":360.0,
+ "overshootSize":[720.0,130.0]
+ },
+ "ScrollBar":
+ {
+ "indicatorShowDuration":0.25,
+ "indicatorHideDuration":0.25,
+ "color":[0.0,0.72,0.9,0.7]
+ },
+ "TextEditor":
+ {
+ "pointSize":18,
+ "primaryCursorColor":[0.0,0.72,0.9,1.0],
+ "secondaryCursorColor":[0.0,0.72,0.9,1.0],
+ "cursorWidth":3,
+ "selectionHighlightColor":[0.75,0.96,1.0,1.0],
+ "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
+ "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
+ "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
+ "enableScrollBar":true,
+ "scrollBarShowDuration":0.8,
+ "scrollBarFadeDuration":0.5,
+ "enableSelection":true
+ },
+ "Popup":
+ {
+ "popupBackgroundImage":"{DALI_IMAGE_DIR}00_popup_bg.9.png",
+ "tailUpImage":"{DALI_IMAGE_DIR}popup_tail_up.png",
+ "tailDownImage":"{DALI_IMAGE_DIR}popup_tail_down.png",
+ "tailLeftImage":"{DALI_IMAGE_DIR}popup_tail_left.png",
+ "tailRightImage":"{DALI_IMAGE_DIR}popup_tail_right.png",
+ "popupBackgroundBorder":[17,17,13,13]
+ },
+ "ConfirmationPopup":
+ {
+ "popupBackgroundImage":"{DALI_IMAGE_DIR}00_popup_bg.9.png",
+ "tailUpImage":"{DALI_IMAGE_DIR}popup_tail_up.png",
+ "tailDownImage":"{DALI_IMAGE_DIR}popup_tail_down.png",
+ "tailLeftImage":"{DALI_IMAGE_DIR}popup_tail_left.png",
+ "tailRightImage":"{DALI_IMAGE_DIR}popup_tail_right.png",
+ "popupBackgroundBorder":[17,17,13,13]
+ },
+ "Slider":
+ {
+ "showPopup": true,
+ "showValue": true,
+ "valuePrecision": 0,
+ "trackVisual":{
+ "url":"{DALI_IMAGE_DIR}slider-skin.9.png",
+ "size":[27,27]
+ },
+ "progressVisual":{
+ "url":"{DALI_IMAGE_DIR}slider-skin-progress.9.png",
+ "size":[27,27]
+ },
+ "handleVisual":{
+ "url":"{DALI_IMAGE_DIR}slider-skin-handle.png",
+ "size":[72,72]
+ },
+ "popupVisual":"{DALI_IMAGE_DIR}slider-popup.9.png",
+ "popupArrowVisual":"{DALI_IMAGE_DIR}slider-popup-arrow.9.png",
+ "disableColor":[0.5, 0.5, 0.5, 1.0],
+ "popupTextColor":[0.5,0.5,0.5,1.0],
+ "hitRegion":[0, 72],
+ "marks":[],
+ "snapToMarks":false,
+ "markTolerance":0.05
+ },
+ "SliderHandleTextLabel":
+ {
+ "textColor":[0.8,0.8,1,1]
+ },
+ "ProgressBar":
+ {
+ "trackVisual":{
+ "visualType":"IMAGE",
+ "url":"{DALI_IMAGE_DIR}progress-bar-skin-track.9.png"
+ },
+ "progressVisual":{
+ "visualType":"IMAGE",
+ "url":"{DALI_IMAGE_DIR}progress-bar-skin-progress.9.png"
+ },
+ "secondaryProgressVisual":{
+ "visualType":"IMAGE",
+ "url":"{DALI_IMAGE_DIR}progress-bar-skin-secondary-progress.9.png"
+ },
+ "indeterminateVisual":{
+ "visualType":"IMAGE",
+ "pixelArea":[0.0, 0.0, 10.0, 1.0],
+ "wrapModeU":"REPEAT",
+ "url":"{DALI_IMAGE_DIR}progress-bar-skin-indeterminate.png"
+ },
+ "indeterminateVisualAnimation":
+ [
+ {
+ "target":"indeterminateVisual",
+ "property":"pixelArea",
+ "initialValue":[0.0, 0.0, 10.0, 1.0],
+ "targetValue":[-1.0, 0.0, 10.0, 1.0],
+ "animator":
+ {
+ "alphaFunction":"DEFAULT",
+ "timePeriod":
+ {
+ "duration":0.8,
+ "delay":0
+ }
+ }
+ }
+ ],
+ "labelVisual":{
+ "visualType": "TEXT",
+ "textColor": [ 1.0, 1.0, 1.0, 1.0 ],
+ "pointSize" : 12.0, // Point size must always be provided to Text Visual
+ "horizontalAlignment": "CENTER",
+ "verticalAlignment": "CENTER"
+ },
+ "progressValue": 0.0,
+ "secondaryProgressValue":0.0,
+ "indeterminate": false
+ },
+ "Button":
+ {
+ "initialAutoRepeatingDelay":2.0,
+ "nextAutoRepeatingDelay":0.9
+ // Note: Visuals added to Button will be used in all derived buttons unless overridden.
+ },
+ "PushButton":
+ {
+ "anchorPoint": [ 0.5, 1.0, 0.5 ],
+ "parentOrigin": [ 0.5, 1.0, 0,5 ],
+ "label":
+ {
+ "visualType": "TEXT",
+ "text" : "BOTTOM_BTN",
+ "horizontalAlignment": "CENTER",
+ "verticalAlignment": "CENTER",
+ "pointSize" : 6.0,
+ "textColor": [0.98,0.98,0.98,1.0]
+ },
+ "background":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_STYLE_IMAGE_DIR}tw_bottom_btn_bg.png",
+ "mixColor": [0.0,0.21,0.29,0.9]
+ },
+ "selectedStateImage":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_STYLE_IMAGE_DIR}tw_bottom_btn_bg.png",
+ "mixColor": [0.0,0.57,0.8,0.3]
+ }
+ },
+ "CheckBoxButton":
+ {
+ "styles":["Button"],
+ "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ],
+ "label":
+ {
+ "visualType": "TEXT",
+ "pointSize" : 10.0, // Point size must always be provided to Text Visual
+ "verticalAlignment": "CENTER"
+ },
+ "unselectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}checkbox-unselected.png"
+ },
+ "selectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}checkbox-selected.png"
+ },
+ "disabledUnselectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}checkbox-unselected-disabled.png"
+ },
+ "disabledSelectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}checkbox-selected-disabled.png"
+ }
+ },
+ "RadioButton":
+ {
+ "styles":["Button"],
+ "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ],
+ "label":
+ {
+ "visualType": "TEXT",
+ "pointSize" : 10.0, // Point size must always be provided to Text Visual
+ "verticalAlignment": "CENTER"
+ },
+ "unselectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}radio-button-unselected.png"
+ },
+ "selectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}radio-button-selected.png"
+ },
+ "disabledUnselectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}radio-button-unselected-disabled.png"
+ },
+ "disabledSelectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{DALI_IMAGE_DIR}radio-button-selected-disabled.png"
+ }
+ }
+ }
+}
##############################
# resource
##############################
+%package resources_360x360
+Summary: default resource files for 360x360
+Requires: %{name} = %{version}-%{release}
+Conflicts: %{name}-resources_480x800
+Conflicts: %{name}-resources_720x1280
+Conflicts: %{name}-resources_1920x1080
+%description resources_360x360
+dali-toolkit default resource files for 360x360
+Contain po / sounds / common images / style / style images
+
%package resources_480x800
Summary: default resource files for 480x800
Requires: %{name} = %{version}-%{release}
+Conflicts: %{name}-resources_360x360
Conflicts: %{name}-resources_720x1280
Conflicts: %{name}-resources_1920x1080
%description resources_480x800
%package resources_720x1280
Summary: default resource files for 720x1280
Requires: %{name} = %{version}-%{release}
+Conflicts: %{name}-resources_360x360
Conflicts: %{name}-resources_480x800
Conflicts: %{name}-resources_1920x1080
%description resources_720x1280
%package resources_1920x1080
Summary: default resource files for 1920x1080
Requires: %{name} = %{version}-%{release}
+Conflicts: %{name}-resources_360x360
Conflicts: %{name}-resources_480x800
Conflicts: %{name}-resources_720x1280
%description resources_1920x1080
# Make folder to contain style and style images
# After making folder, copy local style and style images to new folder
+mkdir -p %{buildroot}%{dali_toolkit_style_files}/360x360
+cp -r dali-toolkit/styles/360x360/* %{buildroot}%{dali_toolkit_style_files}/360x360
mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
# Pre Install
##############################
+%pre resources_360x360
+case "$1" in
+ 2)
+ pushd %{dali_toolkit_style_files}
+ rm -rf ./*
+ popd
+ ;;
+esac
+
%pre resources_480x800
case "$1" in
2)
/sbin/ldconfig
exit 0
+%post resources_360x360
+pushd %{dali_toolkit_style_files}/360x360
+for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
+popd
+
%post resources_480x800
pushd %{dali_toolkit_style_files}/480x800
for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
# Pre Uninstall
##############################
+%preun resources_360x360
+case "$1" in
+ 0)
+ %preun resources_360x360
+ pushd %{dali_toolkit_style_files}
+ mv images ./360x360
+ mv dali-toolkit-default-theme.json ./360x360
+ popd
+ ;;
+esac
+
%preun resources_480x800
case "$1" in
0)
/sbin/ldconfig
exit 0
+%postun resources_360x360
+case "$1" in
+ 0)
+ pushd %{dali_toolkit_style_files}
+ rm -rf *
+ popd
+ ;;
+esac
+
%postun resources_480x800
case "$1" in
0)
%{dev_include_path}/dali-toolkit/*
%{_libdir}/pkgconfig/dali-toolkit.pc
+%files resources_360x360
+%manifest dali-toolkit-resources.manifest
+%defattr(-,root,root,-)
+%{dali_toolkit_image_files}/*
+%{dali_toolkit_sound_files}/*
+%{dali_toolkit_style_files}/360x360/*
+%{dali_toolkit_style_files}/default-feedback-theme.json
+%{_datadir}/locale/*/LC_MESSAGES/*
+
%files resources_480x800
%manifest dali-toolkit-resources.manifest
%defattr(-,root,root,-)