#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
using namespace Dali;
using namespace Toolkit;
const Size CONTROL_SIZE( 300.f, 60.f );
-class ControlImpl : public ControlInterface
+class ControlImpl : public ControlInterface, public Text::EditableControlInterface
{
public:
ControlImpl()
ToolkitTestApplication application;
// Creates a text controller.
- ControlImpl controlImpl;
- ControllerPtr controller = Controller::New( controlImpl );
+ ControllerPtr controller = Controller::New();
DALI_TEST_CHECK( controller );
ToolkitTestApplication application;
// Creates a text controller.
- ControlImpl controlImpl;
- ControllerPtr controller = Controller::New( controlImpl );
+ ControllerPtr controller = Controller::New();
DALI_TEST_CHECK( controller );
ToolkitTestApplication application;
// Creates a text controller.
- ControlImpl controlImpl;
- ControllerPtr controller = Controller::New( controlImpl );
+ ControllerPtr controller = Controller::New();
std::string text;
ImfManager::ImfEventData imfEvent;
ToolkitTestApplication application;
// Creates a text controller.
- ControlImpl controlImpl;
- ControllerPtr controller = Controller::New( controlImpl );
+ ControllerPtr controller = Controller::New();
DALI_TEST_CHECK( controller );
};
Size textArea( 100.f, 50.f );
- Size layoutSize( 100.f, 60.f );
+ Size layoutSize( 100.f, 40.f );
LayoutTextData data =
{
};
Size textArea( 100.f, 50.f );
- Size layoutSize( 100.f, 60.f );
+ Size layoutSize( 100.f, 40.f );
LayoutTextData data =
{
END_TEST;
}
+int UtcDaliTextLayoutEllipsis05(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLayoutEllipsis05");
+
+ const std::string fontLatin( "TizenSans" );
+
+ // Set a known font description
+ FontDescriptionRun fontDescriptionRun01;
+ fontDescriptionRun01.characterRun.characterIndex = 0u;
+ fontDescriptionRun01.characterRun.numberOfCharacters = 51u;
+ fontDescriptionRun01.familyLength = fontLatin.size();
+ fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
+ memcpy( fontDescriptionRun01.familyName, fontLatin.c_str(), fontDescriptionRun01.familyLength );
+ fontDescriptionRun01.familyDefined = true;
+ fontDescriptionRun01.weightDefined = false;
+ fontDescriptionRun01.widthDefined = false;
+ fontDescriptionRun01.slantDefined = false;
+ fontDescriptionRun01.sizeDefined = false;
+
+ Vector<FontDescriptionRun> fontDescriptionRuns;
+ fontDescriptionRuns.PushBack( fontDescriptionRun01 );
+
+ struct LineRun line01 =
+ {
+ { 0u, 11u },
+ { 0u, 11u },
+ 80.f,
+ 15.f,
+ -5.f,
+ 0.f,
+ 0.f,
+ false,
+ true
+ };
+ Vector<LineRun> lines;
+ lines.PushBack( line01 );
+
+ float positions[] =
+ {
+ 1.f, -12.f
+ };
+
+ Size textArea( 100.f, 19.f );
+ Size layoutSize( 100.f, 20.f );
+
+ LayoutTextData data =
+ {
+ "Not enough height.",
+ "Hello world",
+ textArea,
+ 1u,
+ fontDescriptionRuns.Begin(),
+ layoutSize,
+ 1u,
+ positions,
+ 1u,
+ lines.Begin(),
+ LayoutEngine::MULTI_LINE_BOX,
+ 0u,
+ 11u,
+ true,
+ true
+ };
+
+ if( !LayoutTextTest( data ) )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
+
int UtcDaliTextReorderLayout01(void)
{
ToolkitTestApplication application;
application.SendNotification();
application.Render();
- // Check there are the expected number of children ( offscreen root actor, and the offscreen image view
- DALI_TEST_EQUALS( editor.GetChildCount(), 2u, TEST_LOCATION );
+ // Check there are the expected number of children (the stencil).
+ DALI_TEST_EQUALS( editor.GetChildCount(), 1u, TEST_LOCATION );
- Actor offscreenRoot = editor.GetChildAt( 0u );
- DALI_TEST_CHECK( offscreenRoot.IsLayer() );
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
-
- Actor offscreenImage = editor.GetChildAt( 1u );
- DALI_TEST_CHECK( offscreenImage );
+ Actor stencil = editor.GetChildAt( 0u );
// Create a tap event to touch the text editor.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
application.SendNotification();
application.Render();
- Actor layer = editor.GetChildAt( 2u );
+ Actor layer = editor.GetChildAt( 1u );
DALI_TEST_CHECK( layer.IsLayer() );
DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
// Now the text editor has the focus, so it can handle the key events.
application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
// Checks the cursor and the renderer have been created.
DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 2u, TEST_LOCATION ); // The camera actor and the renderer
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 1u, TEST_LOCATION ); // The renderer
Control cursor = Control::DownCast( layer.GetChildAt( 0u ) );
DALI_TEST_CHECK( cursor );
- CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
- DALI_TEST_CHECK( camera );
-
- // The offscreen root actor has a container with all the actors which contain the text renderers.
- Actor container = offscreenRoot.GetChildAt( 1u );
+ // The stencil actor has a container with all the actors which contain the text renderers.
+ Actor container = stencil.GetChildAt( 0u );
for( unsigned int index = 0; index < container.GetChildCount(); ++index )
{
Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2.
// Should not be a renderer.
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor only.
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
END_TEST;
}
application.SendNotification();
application.Render();
- // The offscreen root actor should have three actors: the camera, a renderer and the highlight actor.
- Actor offscreenRoot = editor.GetChildAt( 0u );
- DALI_TEST_CHECK( offscreenRoot.IsLayer() );
-
- CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
- DALI_TEST_CHECK( camera );
+ // The stencil actor should have two actors: the renderer and the highlight actor.
+ Actor stencil = editor.GetChildAt( 0u );
- // The offscreen root actor has a container with all the actors which contain the text renderers.
- Actor container = offscreenRoot.GetChildAt( 1u );
+ // The stencil actor has a container with all the actors which contain the text renderers.
+ Actor container = stencil.GetChildAt( 0u );
for( unsigned int index = 0; index < container.GetChildCount(); ++index )
{
Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
DALI_TEST_CHECK( renderer );
}
- Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
+ Renderer highlight = stencil.GetChildAt( 1u ).GetRendererAt( 0u );
DALI_TEST_CHECK( highlight );
END_TEST;
DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::MAX_LENGTH ), maxNumberOfCharacters, TEST_LOCATION );
// Check exceed policy
- // Set a different exceed policy is not implemented.
+ field.SetProperty( TextField::Property::EXCEED_POLICY, Dali::Toolkit::TextField::EXCEED_POLICY_CLIP );
+ DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::EXCEED_POLICY ), static_cast<int>( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP ), TEST_LOCATION );
+ field.SetProperty( TextField::Property::EXCEED_POLICY, Dali::Toolkit::TextField::EXCEED_POLICY_ORIGINAL );
+ DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::EXCEED_POLICY ), static_cast<int>( Dali::Toolkit::TextField::EXCEED_POLICY_ORIGINAL ), TEST_LOCATION );
// Check that the Alignment properties can be correctly set
field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "END" );
application.SendNotification();
application.Render();
- // Check there are the expected number of children ( offscreen root actor, and the offscreen image view
- DALI_TEST_EQUALS( field.GetChildCount(), 2u, TEST_LOCATION );
+ // Check there are the expected number of children ( stencil ).
+ DALI_TEST_EQUALS( field.GetChildCount(), 1u, TEST_LOCATION );
- Actor offscreenRoot = field.GetChildAt( 0u );
- DALI_TEST_CHECK( offscreenRoot.IsLayer() );
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
-
- Actor offscreenImage = field.GetChildAt( 1u );
- DALI_TEST_CHECK( offscreenImage );
+ Actor stencil = field.GetChildAt( 0u );
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
// Create a tap event to touch the text field.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
application.SendNotification();
application.Render();
- Actor layer = field.GetChildAt( 2u );
+ Actor layer = field.GetChildAt( 1u );
DALI_TEST_CHECK( layer.IsLayer() );
DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
// Now the text field has the focus, so it can handle the key events.
application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) );
// Checks the cursor and the renderer have been created.
DALI_TEST_EQUALS( layer.GetChildCount(), 1u, TEST_LOCATION ); // The cursor.
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 2u, TEST_LOCATION ); // The camera actor and the renderer
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 1u, TEST_LOCATION ); // The renderer
Control cursor = Control::DownCast( layer.GetChildAt( 0u ) );
DALI_TEST_CHECK( cursor );
- CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
- DALI_TEST_CHECK( camera );
-
// The offscreen root actor has a container with all the actors which contain the text renderers.
- Actor container = offscreenRoot.GetChildAt( 1u );
+ Actor container = stencil.GetChildAt( 0u );
for( unsigned int index = 0; index < container.GetChildCount(); ++index )
{
Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2.
// Should not be a renderer.
- DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor only.
+ DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
END_TEST;
}
application.SendNotification();
application.Render();
- // The offscreen root actor should have three actors: the camera, a renderer and the highlight actor.
- Actor offscreenRoot = field.GetChildAt( 1u );
- DALI_TEST_CHECK( offscreenRoot.IsLayer() );
-
- CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
- DALI_TEST_CHECK( camera );
+ // The offscreen root actor should have two actors: the renderer and the highlight actor.
+ Actor stencil = field.GetChildAt( 0u );
// The offscreen root actor has a container with all the actors which contain the text renderers.
- Actor container = offscreenRoot.GetChildAt( 1u );
+ Actor container = stencil.GetChildAt( 0u );
for( unsigned int index = 0; index < container.GetChildCount(); ++index )
{
Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u );
DALI_TEST_CHECK( renderer );
}
- Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
+ Renderer highlight = stencil.GetChildAt( 1u ).GetRendererAt( 0u );
DALI_TEST_CHECK( highlight );
END_TEST;
SendPan(application, Gesture::Finished, pos);
Wait(application, RENDER_FRAME_INTERVAL);
- Actor offscreenRoot = field.GetChildAt( 1u );
+ Actor stencil = field.GetChildAt( 1u );
END_TEST;
}
END_TEST;
}
+
+int UtcDaliToolkitTextlabelEllipsis(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelEllipsis");
+
+ TextLabel label = TextLabel::New("Hello world");
+ DALI_TEST_CHECK( label );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ Stage::GetCurrent().Add( label );
+
+ // Turn on all the effects
+ label.SetAnchorPoint( AnchorPoint::CENTER );
+ label.SetParentOrigin( ParentOrigin::CENTER );
+ label.SetSize( 360.0f, 10.f );
+
+ try
+ {
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+ }
+ catch( ... )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ END_TEST;
+}
END_TEST;
}
+int UtcDaliVisualPremultipliedAlpha(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualPremultipliedAlpha" );
+
+ VisualFactory factory = VisualFactory::Get();
+
+ // image visual, test default value ( false )
+ {
+ Visual::Base imageVisual = factory.CreateVisual(
+ Property::Map()
+ .Add( Visual::Property::TYPE, Visual::IMAGE )
+ .Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ) );
+
+ Dali::Property::Map visualMap;
+ imageVisual.CreatePropertyMap( visualMap );
+ Property::Value* value = visualMap.Find( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+
+ // test values
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<bool>(), false, TEST_LOCATION );
+ }
+
+ // image visual, override premultiplied
+ {
+ Visual::Base imageVisual = factory.CreateVisual(
+ Property::Map()
+ .Add( Visual::Property::TYPE, Visual::IMAGE )
+ .Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME )
+ .Add( DevelVisual::Property::PREMULTIPLIED_ALPHA, true ) );
+
+ Dali::Property::Map visualMap;
+ imageVisual.CreatePropertyMap( visualMap );
+ Property::Value* value = visualMap.Find( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+
+ // test values
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<bool>(), true, TEST_LOCATION);
+ }
+
+ // svg visual ( premultiplied alpha by default is true )
+ {
+ Visual::Base imageVisual = factory.CreateVisual(
+ Property::Map()
+ .Add( Visual::Property::TYPE, Visual::IMAGE )
+ .Add( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ) );
+
+ Dali::Property::Map visualMap;
+ imageVisual.CreatePropertyMap( visualMap );
+ Property::Value* value = visualMap.Find( DevelVisual::Property::PREMULTIPLIED_ALPHA );
+
+ // test values
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<bool>(), true, TEST_LOCATION );
+ }
+
+ END_TEST;
+}
--- /dev/null
+#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
+
+/*
+ * Copyright (c) 2016 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/visuals/visual-properties.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelVisual
+{
+
+/**
+ * @brief All the visual types.
+ */
+enum Type
+{
+ BORDER = Dali::Toolkit::Visual::BORDER,
+ COLOR = Dali::Toolkit::Visual::COLOR,
+ GRADIENT = Dali::Toolkit::Visual::GRADIENT,
+ IMAGE = Dali::Toolkit::Visual::IMAGE,
+ MESH = Dali::Toolkit::Visual::MESH,
+ PRIMITIVE = Dali::Toolkit::Visual::PRIMITIVE,
+ WIREFRAME = Dali::Toolkit::Visual::WIREFRAME,
+
+ TEXT = WIREFRAME + 1, ///< Renders text.
+};
+
+namespace Property
+{
+
+enum Type
+{
+ TYPE = Dali::Toolkit::Visual::Property::TYPE,
+ SHADER = Dali::Toolkit::Visual::Property::SHADER,
+
+ /**
+ * @brief The transform used by the visual.
+ * @details Name "transform", type Property::Map.
+
+ * @note Optional.
+ * @see DevelVisual::Transform::Property
+ */
+ TRANSFORM = SHADER + 1, // Dali::Toolkit::Visual::Property::SHADER + 1
+
+ /**
+ * @brief Enables/disables premultiplied alpha.
+ * The premultiplied alpha is false by default unless this behaviour is modified
+ * by the derived Visual type.
+
+ * @details Name "premultipliedAlpha", type Property::Boolean.
+
+ * @note Optional.
+ */
+ PREMULTIPLIED_ALPHA = SHADER + 2, // Dali::Toolkit::Visual::Property::SHADER + 2
+};
+
+} //namespace Property
+
+namespace Transform
+{
+
+namespace Property
+{
+
+enum Type
+{
+ /**
+ * @brief Offset of the visual. It can be either relative (percentage of the parent)
+ * or absolute (in world units).
+ * @details Name "offset", type Property::VECTOR2
+ */
+ OFFSET,
+
+ /**
+ * @brief Size of the visual. It can be either relative (percentage of the parent)
+ * or absolute (in world units).
+ * @details Name "size", type Property::VECTOR2
+ */
+ SIZE,
+
+ /**
+ * @brief The origin of the visual within its control area.
+ * @details Name "origin", type Align::Type (Property::INTEGER) or Property::STRING.
+ * @see Toolkit::Align
+ */
+ ORIGIN,
+
+ /**
+ * @brief The anchor-point of the visual
+ * @details Name "anchorPoint", type Align::Type (Property::INTEGER) or Property::STRING.
+ * @see Toolkit::Align
+ */
+ ANCHOR_POINT,
+
+ /**
+ * @brief Indicates which components of the offset and size are relative
+ * (percentage of the parent) or absolute (in world units).
+ * 0 indicates the component is relative, and 1 absolute.
+ * @details Name "offsetSizeMode", type Property::VECTOR4
+ */
+ OFFSET_SIZE_MODE
+};
+
+} //namespace Property
+
+} // namespace Transform
+
+} // namespace DevelVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
DALI_SCRIPT_WARNING( "Cannot find property on object\n" );
continue;
}
-
- if( propIndex == Property::INVALID_INDEX)
- {
- DALI_ASSERT_ALWAYS( propIndex != Property::INVALID_INDEX && "Animation must specify a valid property" );
- continue;
- }
}
// these are the defaults
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/text/rendering-backend.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/text/rendering/text-backend.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
#include <dali-toolkit/internal/text/text-font-style.h>
{
Actor self = Self();
- mController = Text::Controller::New( *this );
+ mController = Text::Controller::New( this, this );
mDecorator = Text::Decorator::New( *mController,
*mController );
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
self.OnStageSignal().Connect( this, &TextEditor::OnStageConnect );
+
+ // Creates an extra control to be used as stencil buffer.
+ mStencil = Control::New();
+ mStencil.SetAnchorPoint( AnchorPoint::CENTER );
+ mStencil.SetParentOrigin( ParentOrigin::CENTER );
+
+ // Creates a background visual. Even if the color is transparent it updates the stencil.
+ Property::Map backGroundMap;
+ backGroundMap[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+ backGroundMap[ColorVisual::Property::MIX_COLOR] = Color::TRANSPARENT;
+
+ mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND, backGroundMap );
+
+ // Enable the clipping property.
+ mStencil.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ mStencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+ self.Add( mStencil );
}
void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
}
- EnableClipping( true, size );
RenderText( updateTextType );
}
void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType )
{
- Actor self = Self();
Actor renderableActor;
if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
mRenderableActor.SetPosition( scrollOffset.x, scrollOffset.y );
- Actor clipRootActor;
- if( mClipper )
- {
- clipRootActor = mClipper->GetRootActor();
- }
+ // Make sure the actors are parented correctly with/without clipping
+ Actor self = mStencil ? mStencil : Self();
for( std::vector<Actor>::const_iterator it = mClippingDecorationActors.begin(),
endIt = mClippingDecorationActors.end();
it != endIt;
++it )
{
- Actor actor = *it;
-
- if( clipRootActor )
- {
- clipRootActor.Add( actor );
- }
- else
- {
- self.Add( actor );
- }
+ self.Add( *it );
}
mClippingDecorationActors.clear();
- // Make sure the actor is parented correctly with/without clipping
- if( clipRootActor )
- {
- clipRootActor.Add( mRenderableActor );
- }
- else
- {
- self.Add( mRenderableActor );
- }
+ self.Add( mRenderableActor );
}
}
return mController->KeyEvent( event );
}
-void TextEditor::AddDecoration( Actor& actor, bool needsClipping )
-{
- if( actor )
- {
- if( needsClipping )
- {
- mClippingDecorationActors.push_back( actor );
- }
- else
- {
- Self().Add( actor );
- }
- }
-}
-
void TextEditor::RequestTextRelayout()
{
RelayoutRequest();
mTextChangedSignal.Emit( handle );
}
+void TextEditor::MaxLengthReached()
+{
+ // Nothing to do as TextEditor doesn't emit a max length reached signal.
+}
+
void TextEditor::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
{
Dali::Toolkit::TextEditor handle( GetOwner() );
mInputStyleChangedSignal.Emit( handle, editorInputStyleMask );
}
-void TextEditor::MaxLengthReached()
+void TextEditor::AddDecoration( Actor& actor, bool needsClipping )
{
- // Nothing to do as TextEditor doesn't emit a max length reached signal.
+ if( actor )
+ {
+ if( needsClipping )
+ {
+ mClippingDecorationActors.push_back( actor );
+ }
+ else
+ {
+ Self().Add( actor );
+ }
+ }
}
void TextEditor::OnStageConnect( Dali::Actor actor )
}
}
-void TextEditor::EnableClipping( bool clipping, const Vector2& size )
-{
- if( clipping )
- {
- // Not worth to created clip actor if width or height is equal to zero.
- if( size.width > Math::MACHINE_EPSILON_1000 && size.height > Math::MACHINE_EPSILON_1000 )
- {
- if( !mClipper )
- {
- Actor self = Self();
-
- mClipper = Clipper::New( size );
- self.Add( mClipper->GetRootActor() );
- self.Add( mClipper->GetImageView() );
- }
- else if ( mClipper )
- {
- mClipper->Refresh( size );
- }
- }
- }
- else
- {
- // Note - this will automatically remove the root actor & the image view
- mClipper.Reset();
- }
-}
-
void TextEditor::OnClipboardTextSelected( ClipboardEventNotifier& clipboard )
{
mController->PasteClipboardItemEvent();
TextEditor::~TextEditor()
{
- mClipper.Reset();
+ UnparentAndReset( mStencil );
if( ( NULL != mIdleCallback ) && Adaptor::IsAvailable() )
{
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
-#include <dali-toolkit/internal/text/clipping/text-clipper.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
/**
* @brief A control which renders a long text string with styles.
*/
-class TextEditor : public Control, public Text::ControlInterface
+class TextEditor : public Control, public Text::ControlInterface, public Text::EditableControlInterface
{
public:
// From ControlInterface
/**
- * @copydoc Text::ControlInterface::AddDecoration()
- */
- virtual void AddDecoration( Actor& actor, bool needsClipping );
-
- /**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
virtual void RequestTextRelayout();
+// From EditableControlInterface
+
/**
* @copydoc Text::ControlInterface::TextChanged()
*/
*/
virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+ /**
+ * @copydoc Text::ControlInterface::AddDecoration()
+ */
+ virtual void AddDecoration( Actor& actor, bool needsClipping );
+
private: // Implementation
/**
void GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType );
/**
- * @brief Enable or disable clipping.
- *
- * @param[in] clipping True if clipping should be enabled.
- * @param[in] size The area to clip within.
- */
- void EnableClipping( bool clipping, const Vector2& size );
-
- /**
* @brief Callback when keyboard is shown/hidden.
*
* @param[in] keyboardShown True if keyboard is shown.
Text::ControllerPtr mController;
Text::RendererPtr mRenderer;
Text::DecoratorPtr mDecorator;
- Text::ClipperPtr mClipper;
+ Toolkit::Control mStencil;
std::vector<Actor> mClippingDecorationActors; ///< Decoration actors which need clipping.
Actor mRenderableActor;
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_EDITOR_H
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/text/rendering-backend.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/text/rendering/text-backend.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
#include <dali-toolkit/internal/text/text-font-style.h>
}
case Toolkit::TextField::Property::EXCEED_POLICY:
{
- // TODO
+ impl.mExceedPolicy = value.Get<int>();
+
+ if( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == impl.mExceedPolicy )
+ {
+ impl.EnableClipping();
+ }
+ else
+ {
+ UnparentAndReset( impl.mStencil );
+ }
+ impl.RequestTextRelayout();
break;
}
case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
{
Actor self = Self();
- mController = Text::Controller::New( *this );
+ mController = Text::Controller::New( this, this );
// When using the vector-based rendering, the size of the GLyphs are different
TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
self.OnStageSignal().Connect( this, &TextField::OnStageConnect );
+
+ if( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy )
+ {
+ EnableClipping();
+ }
}
void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
}
- EnableClipping( ( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy ), size );
RenderText( updateTextType );
}
void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
{
- Actor self = Self();
Actor renderableActor;
if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
mRenderableActor.SetPosition( scrollOffset.x, scrollOffset.y );
- Actor clipRootActor;
- if( mClipper )
- {
- clipRootActor = mClipper->GetRootActor();
- }
+ // Make sure the actors are parented correctly with/without clipping
+ Actor self = mStencil ? mStencil : Self();
for( std::vector<Actor>::const_iterator it = mClippingDecorationActors.begin(),
endIt = mClippingDecorationActors.end();
it != endIt;
++it )
{
- Actor actor = *it;
-
- if( clipRootActor )
- {
- clipRootActor.Add( actor );
- }
- else
- {
- self.Add( actor );
- }
+ self.Add( *it );
}
mClippingDecorationActors.clear();
- // Make sure the actor is parented correctly with/without clipping
- if( clipRootActor )
- {
- clipRootActor.Add( mRenderableActor );
- }
- else
- {
- self.Add( mRenderableActor );
- }
+ self.Add( mRenderableActor );
}
}
return mController->KeyEvent( event );
}
-void TextField::AddDecoration( Actor& actor, bool needsClipping )
-{
- if( actor )
- {
- if( needsClipping )
- {
- mClippingDecorationActors.push_back( actor );
- }
- else
- {
- Self().Add( actor );
- }
- }
-}
-
void TextField::RequestTextRelayout()
{
RelayoutRequest();
mTextChangedSignal.Emit( handle );
}
+void TextField::MaxLengthReached()
+{
+ Dali::Toolkit::TextField handle( GetOwner() );
+ mMaxLengthReachedSignal.Emit( handle );
+}
+
void TextField::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
{
Dali::Toolkit::TextField handle( GetOwner() );
mInputStyleChangedSignal.Emit( handle, fieldInputStyleMask );
}
+void TextField::AddDecoration( Actor& actor, bool needsClipping )
+{
+ if( actor )
+ {
+ if( needsClipping )
+ {
+ mClippingDecorationActors.push_back( actor );
+ }
+ else
+ {
+ Self().Add( actor );
+ }
+ }
+}
+
void TextField::OnStageConnect( Dali::Actor actor )
{
if ( mHasBeenStaged )
}
}
-void TextField::MaxLengthReached()
-{
- Dali::Toolkit::TextField handle( GetOwner() );
- mMaxLengthReachedSignal.Emit( handle );
-}
-
ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
}
}
-void TextField::EnableClipping( bool clipping, const Vector2& size )
+void TextField::EnableClipping()
{
- if( clipping )
+ if( !mStencil )
{
- // Not worth to created clip actor if width or height is equal to zero.
- if( size.width > Math::MACHINE_EPSILON_1000 && size.height > Math::MACHINE_EPSILON_1000 )
- {
- if( !mClipper )
- {
- Actor self = Self();
+ // Creates an extra control to be used as stencil buffer.
+ mStencil = Control::New();
+ mStencil.SetAnchorPoint( AnchorPoint::CENTER );
+ mStencil.SetParentOrigin( ParentOrigin::CENTER );
- mClipper = Clipper::New( size );
- self.Add( mClipper->GetRootActor() );
- self.Add( mClipper->GetImageView() );
- }
- else if ( mClipper )
- {
- mClipper->Refresh( size );
- }
- }
- }
- else
- {
- // Note - this will automatically remove the root actor & the image view
- mClipper.Reset();
+ // Creates a background visual. Even if the color is transparent it updates the stencil.
+ Property::Map backGroundMap;
+ backGroundMap[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+ backGroundMap[ColorVisual::Property::MIX_COLOR] = Color::TRANSPARENT;
+
+ mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND, backGroundMap );
+
+ // Enable the clipping property.
+ mStencil.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ mStencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+ Self().Add( mStencil );
}
}
TextField::~TextField()
{
- mClipper.Reset();
+ UnparentAndReset( mStencil );
if( ( NULL != mIdleCallback ) && Adaptor::IsAvailable() )
{
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/text-controls/text-field.h>
-#include <dali-toolkit/internal/text/clipping/text-clipper.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
/**
* @brief A control which renders a short text string.
*/
-class TextField : public Control, public Text::ControlInterface
+class TextField : public Control, public Text::ControlInterface, public Text::EditableControlInterface
{
public:
// From ControlInterface
/**
- * @copydoc Text::ControlInterface::AddDecoration()
- */
- virtual void AddDecoration( Actor& actor, bool needsClipping );
-
- /**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
virtual void RequestTextRelayout();
+// From EditableControlInterface
+
/**
* @copydoc Text::ControlInterface::TextChanged()
*/
*/
virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+ /**
+ * @copydoc Text::ControlInterface::AddDecoration()
+ */
+ virtual void AddDecoration( Actor& actor, bool needsClipping );
+
private: // Implementation
/**
/**
* @brief Enable or disable clipping.
- *
- * @param[in] clipping True if clipping should be enabled.
- * @param[in] size The area to clip within.
*/
- void EnableClipping( bool clipping, const Vector2& size );
+ void EnableClipping();
/**
* @brief Callback when keyboard is shown/hidden.
Text::ControllerPtr mController;
Text::RendererPtr mRenderer;
Text::DecoratorPtr mDecorator;
- Text::ClipperPtr mClipper; ///< For EXCEED_POLICY_CLIP
+ Toolkit::Control mStencil; ///< For EXCEED_POLICY_CLIP
std::vector<Actor> mClippingDecorationActors; ///< Decoration actors which need clipping.
Actor mRenderableActor;
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_FIELD_H
{
Actor self = Self();
- mController = Text::Controller::New( *this );
+ mController = Text::Controller::New( this );
// When using the vector-based rendering, the size of the GLyphs are different
TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
}
}
-void TextLabel::AddDecoration( Actor& actor, bool needsClipping )
-{
- // TextLabel does not show decorations
-}
-
void TextLabel::OnStageConnection( int depth )
{
// Call the Control::OnStageConnection() to set the depth of the background.
// The depth of the text renderer is set in the RenderText() called from OnRelayout().
}
-void TextLabel::TextChanged()
-{
- // TextLabel does not provide a signal for this.
-}
-
-void TextLabel::MaxLengthReached()
-{
- // Pure Virtual from TextController Interface, only needed when inputting text
-}
-
-void TextLabel::InputStyleChanged( Text::InputStyle::Mask inputStyleMask )
-{
- // TextLabel does not provide a signal for this.
-}
-
void TextLabel::ScrollingFinished()
{
// Pure Virtual from TextScroller Interface
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
+#include <dali-toolkit/internal/text/text-control-interface.h>
#include <dali-toolkit/internal/text/text-controller.h>
#include <dali-toolkit/internal/text/text-scroller-interface.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
virtual float GetHeightForWidth( float width );
/**
- * @copydoc Text::ControlInterface::AddDecoration()
- */
- virtual void AddDecoration( Actor& actor, bool needsClipping );
-
- /**
* @copydoc Control::OnStageConnection()
*/
virtual void OnStageConnection( int depth );
+// From ControlInterface
+
/**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
virtual void RequestTextRelayout();
- /**
- * @copydoc Text::ControlInterface::TextChanged()
- */
- virtual void TextChanged();
-
- /**
- * @copydoc Text::ControlInterface::MaxLengthReached()
- */
- virtual void MaxLengthReached();
-
- /**
- * @copydoc Text::ControlInterface::InputStyleChanged()
- */
- virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
-
private: // from TextScroller
/**
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
$(toolkit_src_dir)/styling/style-manager-impl.cpp \
$(toolkit_src_dir)/text/bidirectional-support.cpp \
$(toolkit_src_dir)/text/character-set-conversion.cpp \
- $(toolkit_src_dir)/text/clipping/text-clipper.cpp \
$(toolkit_src_dir)/text/color-segmentation.cpp \
$(toolkit_src_dir)/text/cursor-helper-functions.cpp \
$(toolkit_src_dir)/text/glyph-metrics-helper.cpp \
$(toolkit_src_dir)/text/property-string-parser.cpp \
$(toolkit_src_dir)/text/segmentation.cpp \
$(toolkit_src_dir)/text/shaper.cpp \
- $(toolkit_src_dir)/text/text-control-interface.cpp \
$(toolkit_src_dir)/text/text-controller.cpp \
$(toolkit_src_dir)/text/text-controller-impl.cpp \
$(toolkit_src_dir)/text/text-effects-style.cpp \
+++ /dev/null
-/*
- * Copyright (c) 2016 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/internal/text/clipping/text-clipper.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/stage.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/public-api/rendering/renderer.h>
-
-namespace
-{
-
-// Currently on desktop machines 2k x 2k is the maximum frame buffer size, on target is 4k x 4k.
-const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f;
-
-} // namespace
-
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-ClipperPtr Clipper::New( const Vector2& size )
-{
- ClipperPtr clipper( new Clipper() );
-
- // Second-phase init
- clipper->Initialize( size );
-
- return clipper;
-}
-
-Actor Clipper::GetRootActor() const
-{
- return mOffscreenRootActor;
-}
-
-Actor Clipper::GetImageView() const
-{
- return mImageView;
-}
-
-void Clipper::Refresh( const Vector2& size )
-{
- const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
- std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );
-
- const bool sizeChanged = offscreenSize != mCurrentOffscreenSize;
-
- if( sizeChanged )
- {
- // Reconfigure camera for current size.
- mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );
-
- // Recreate frame buffer for offscreen rendering when the size changes.
- FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
- offscreenSize.height,
- Pixel::RGBA8888 );
-
- mOffscreenRootActor.SetSize( size );
-
- mImageView.SetSize( offscreenSize );
- mImageView.SetImage( frameBufferImage );
- mRenderTask.SetTargetFrameBuffer( frameBufferImage );
-
- // Stores current sizPe to avoid create new Dali resources if text changes.
- mCurrentOffscreenSize = offscreenSize;
- }
-
- mRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
-}
-
-void Clipper::Initialize( const Vector2& size )
-{
- const Size offscreenSize( std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.width ),
- std::min( MAX_OFFSCREEN_RENDERING_SIZE, size.height ) );
-
- // Create a root actor and an image view for offscreen rendering.
- mOffscreenRootActor = Layer::New();
- mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
- mOffscreenRootActor.SetInheritPosition( false );
- mOffscreenRootActor.SetInheritScale( false );
- mOffscreenRootActor.SetDepthTestDisabled( true );
- mOffscreenRootActor.SetSize( offscreenSize );
-
- mImageView = ImageView::New();
- mImageView.SetParentOrigin( ParentOrigin::CENTER );
- mImageView.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
- mImageView.SetSize( offscreenSize );
-
- // Creates a new camera actor.
- mOffscreenCameraActor = CameraActor::New();
- mOffscreenCameraActor.SetParentOrigin( ParentOrigin::CENTER );
- mOffscreenCameraActor.SetOrthographicProjection( offscreenSize );
- mOffscreenRootActor.Add( mOffscreenCameraActor ); // camera to shoot the offscreen text
-
- // Creates a new render task.
- mRenderTask = Stage::GetCurrent().GetRenderTaskList().CreateTask();
- mRenderTask.SetSourceActor( mOffscreenRootActor );
- mRenderTask.SetClearColor( Color::TRANSPARENT );
- mRenderTask.SetClearEnabled( true );
- mRenderTask.SetExclusive( true );
- mRenderTask.SetCameraActor( mOffscreenCameraActor );
-
- // Creates a frame buffer for offscreen rendering
- FrameBufferImage frameBufferImage = FrameBufferImage::New( offscreenSize.width,
- offscreenSize.height,
- Pixel::RGBA8888 );
- mImageView.SetImage( frameBufferImage );
- mRenderTask.SetTargetFrameBuffer( frameBufferImage );
- mImageView.OnStageSignal().Connect(this, &Clipper::OnStageConnect);
-
- // Stores current size to avoid create new Dali resources if text changes.
- mCurrentOffscreenSize = offscreenSize;
-}
-
-void Clipper::OnStageConnect( Dali::Actor actor )
-{
- Renderer renderer = mImageView.GetRendererAt(0);
- renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE );
- renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ONE_MINUS_SRC_ALPHA );
- renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA, BlendFactor::ONE );
- renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ONE );
-}
-
-Clipper::Clipper()
-{
-}
-
-Clipper::~Clipper()
-{
- if( Stage::IsInstalled() )
- {
- UnparentAndReset( mOffscreenRootActor );
- UnparentAndReset( mImageView );
-
- Stage::GetCurrent().GetRenderTaskList().RemoveTask( mRenderTask );
- }
-}
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_CLIPPER_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_CLIPPER_H__
-
-/*
- * Copyright (c) 2015 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/actors/layer.h>
-#include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/render-tasks/render-task.h>
-#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali/public-api/signals/connection-tracker.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-class Clipper;
-typedef IntrusivePtr<Clipper> ClipperPtr;
-
-/**
- * @brief A helper class for clipping actors using a FrameBufferImage.
- */
-class Clipper : public RefObject, public ConnectionTracker
-{
-public:
-
- /**
- * @brief Create a clipper.
- *
- * @param[in] size The size of the clipping region.
- */
- static ClipperPtr New( const Vector2& size );
-
- /**
- * @brief Children added to this actor will be clipped with the specified region.
- *
- * @note This is done by rendering to a FrameBufferImage which must then be displayed; see also GetImageView().
- * @return The root actor.
- */
- Actor GetRootActor() const;
-
- /**
- * @brief This actor will display the resulting FrameBufferImage.
- *
- * @return The image view.
- */
- Actor GetImageView() const;
-
- /**
- * @brief Refresh the contents of the FrameBufferImage.
- *
- * @param[in] size The size of the clipping region.
- */
- void Refresh( const Vector2& size );
-
-private: // Implementation
-
- /**
- * @brief Second-phase init
- *
- * @param[in] size The size of the clipping region.
- */
- void Initialize( const Vector2& size );
-
- /**
- * The renderer is not created until the clipper actor is set on stage, only by then the blend function could be set.
- *
- * @param[in] actor The actor connected to stage.
- */
- void OnStageConnect( Dali::Actor actor );
-
- /**
- * Construct a new Clipper.
- */
- Clipper();
-
- /**
- * A reference counted object may only be deleted by calling Unreference()
- */
- virtual ~Clipper();
-
-private:
-
- // Undefined copy constructor and assignment operators
- Clipper(const Clipper&);
- Clipper& operator=(const Clipper& rhs);
-
-private: // Data
-
- Layer mOffscreenRootActor;
- CameraActor mOffscreenCameraActor;
- ImageView mImageView;
- RenderTask mRenderTask;
- Vector2 mCurrentOffscreenSize;
-};
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_CLIPPER_H__
lineRun->ellipsis = true;
layoutSize.width = layoutParameters.boundingBox.width;
- layoutSize.height += ( lineRun->ascender + -lineRun->descender );
+ if( layoutSize.height < Math::MACHINE_EPSILON_1000 )
+ {
+ layoutSize.height += ( lineRun->ascender + -lineRun->descender );
+ }
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
+++ /dev/null
-/*
- * Copyright (c) 2015 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/internal/text/text-control-interface.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-ControlInterface::ControlInterface()
-{
-}
-
-ControlInterface::~ControlInterface()
-{
-}
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali
-#ifndef __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
-#define __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H
+#define DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
*/
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/input-style.h>
-
namespace Dali
{
-class Actor;
-
namespace Toolkit
{
public:
/**
- * @brief Constructor.
- */
- ControlInterface();
-
- /**
* @brief Virtual destructor.
*/
- virtual ~ControlInterface();
-
- /**
- * @brief Add a decoration.
- *
- * @param[in] decoration The actor displaying a decoration.
- * @param[in] needsClipping Whether the actor needs clipping.
- */
- virtual void AddDecoration( Actor& actor, bool needsClipping ) = 0;
+ virtual ~ControlInterface()
+ {}
/**
* @brief Called to request a text relayout.
*/
virtual void RequestTextRelayout() = 0;
-
- /**
- * @brief Called to signal that text has been inserted or deleted.
- */
- virtual void TextChanged() = 0;
-
- /**
- * @brief Called when the number of characters to be inserted exceeds the maximum limit
- */
- virtual void MaxLengthReached() = 0;
-
- /**
- * @brief Called to signal that input style has been changed.
- *
- * @param[in] inputStyleMask Mask with the bits of the input style that has changed.
- */
- virtual void InputStyleChanged( InputStyle::Mask inputStyleMask ) = 0;
};
} // namespace Text
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROL_INTERFACE_H
#include <dali-toolkit/internal/text/multi-language-support.h>
#include <dali-toolkit/internal/text/segmentation.h>
#include <dali-toolkit/internal/text/shaper.h>
+#include <dali-toolkit/internal/text/text-control-interface.h>
#include <dali-toolkit/internal/text/text-run-container.h>
namespace
mGrabHandleEnabled( true ),
mGrabHandlePopupEnabled( true ),
mSelectionEnabled( true ),
+ mUpdateCursorHookPosition( false ),
mUpdateCursorPosition( false ),
mUpdateGrabHandlePosition( false ),
mUpdateLeftSelectionPosition( false ),
{
ChangeState ( EventData::EDITING_WITH_POPUP );
mEventData->mDecoratorUpdated = true;
+ mEventData->mUpdateInputStyle = true;
}
}
void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize )
{
+ if( LayoutEngine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() )
+ {
+ // Nothing to do if the text is single line.
+ return;
+ }
+
// Clamp between -space & 0.
if( layoutSize.height > mVisualModel->mControlSize.height )
{
void Controller::Impl::RequestRelayout()
{
- mControlInterface.RequestTextRelayout();
+ if( NULL != mControlInterface )
+ {
+ mControlInterface->RequestTextRelayout();
+ }
}
} // namespace Text
-#ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
-#define __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H
+#define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
struct Controller::Impl
{
- Impl( ControlInterface& controlInterface )
+ Impl( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface )
: mControlInterface( controlInterface ),
+ mEditableControlInterface( editableControlInterface ),
mLogicalModel(),
mVisualModel(),
mFontDefaults( NULL ),
public:
- ControlInterface& mControlInterface; ///< Reference to the text controller.
+ ControlInterface* mControlInterface; ///< Reference to the text controller.
+ EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller.
LogicalModelPtr mLogicalModel; ///< Pointer to the logical model.
VisualModelPtr mVisualModel; ///< Pointer to the visual model.
FontDefaults* mFontDefaults; ///< Avoid allocating this when the user does not specify a font.
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROLLER_H
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
#include <dali-toolkit/internal/text/markup-processor.h>
#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
namespace
{
// public : Constructor.
-ControllerPtr Controller::New( ControlInterface& controlInterface )
+ControllerPtr Controller::New()
+{
+ return ControllerPtr( new Controller() );
+}
+
+ControllerPtr Controller::New( ControlInterface* controlInterface )
{
return ControllerPtr( new Controller( controlInterface ) );
}
+ControllerPtr Controller::New( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface )
+{
+ return ControllerPtr( new Controller( controlInterface,
+ editableControlInterface ) );
+}
+
// public : Configure the text controller.
void Controller::EnableTextInput( DecoratorPtr decorator )
mImpl->mEventData->mEventQueue.clear();
}
- // Do this last since it provides callbacks into application code
- mImpl->mControlInterface.TextChanged();
+ // Do this last since it provides callbacks into application code.
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ mImpl->mEditableControlInterface->TextChanged();
+ }
}
void Controller::GetText( std::string& text ) const
// Set the update info to relayout the whole text.
mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
+
+ // Store the size used to layout the text.
+ mImpl->mVisualModel->mControlSize = size;
}
// Whether there are modify events.
{
const InputStyle::Mask mask = *it;
- // Emit the input style changed signal.
- mImpl->mControlInterface.InputStyleChanged( mask );
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ // Emit the input style changed signal.
+ mImpl->mEditableControlInterface->InputStyleChanged( mask );
+ }
}
mImpl->mEventData->mInputStyleChangedQueue.Clear();
mImpl->RequestRelayout();
}
- if( textChanged )
+ if( textChanged &&
+ ( NULL != mImpl->mEditableControlInterface ) )
{
// Do this last since it provides callbacks into application code
- mImpl->mControlInterface.TextChanged();
+ mImpl->mEditableControlInterface->TextChanged();
}
return true;
ImfManager::ImfCallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false );
- if( requestRelayout )
+ if( requestRelayout &&
+ ( NULL != mImpl->mEditableControlInterface ) )
{
// Do this last since it provides callbacks into application code
- mImpl->mControlInterface.TextChanged();
+ mImpl->mEditableControlInterface->TextChanged();
}
return callbackData;
void Controller::AddDecoration( Actor& actor, bool needsClipping )
{
- mImpl->mControlInterface.AddDecoration( actor, needsClipping );
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ mImpl->mEditableControlInterface->AddDecoration( actor, needsClipping );
+ }
}
void Controller::DecorationEvent( HandleType handleType, HandleState state, float x, float y )
mImpl->mEventData->mScrollAfterDelete = true;
mImpl->RequestRelayout();
- mImpl->mControlInterface.TextChanged();
+
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ mImpl->mEditableControlInterface->TextChanged();
+ }
break;
}
case Toolkit::TextSelectionPopup::COPY:
mImpl->ResetImfManager();
- // Do this last since it provides callbacks into application code
- mImpl->mControlInterface.MaxLengthReached();
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ // Do this last since it provides callbacks into application code
+ mImpl->mEditableControlInterface->MaxLengthReached();
+ }
}
}
mImpl->ChangeState( EventData::EDITING );
mImpl->RequestRelayout();
- // Do this last since it provides callbacks into application code
- mImpl->mControlInterface.TextChanged();
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ // Do this last since it provides callbacks into application code
+ mImpl->mEditableControlInterface->TextChanged();
+ }
}
bool Controller::RemoveText( int cursorOffset,
mImpl->mVisualModel->SetLayoutSize( layoutSize );
}
} // view updated
-
- // Store the size used to layout the text.
- mImpl->mVisualModel->mControlSize = size;
}
if( NO_OPERATION != ( ALIGN & operations ) )
// private : Private contructors & copy operator.
-Controller::Controller( ControlInterface& controlInterface )
+Controller::Controller()
: mImpl( NULL )
{
- mImpl = new Controller::Impl( controlInterface );
+ mImpl = new Controller::Impl( NULL, NULL );
+}
+
+Controller::Controller( ControlInterface* controlInterface )
+{
+ mImpl = new Controller::Impl( controlInterface, NULL );
+}
+
+Controller::Controller( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface )
+{
+ mImpl = new Controller::Impl( controlInterface,
+ editableControlInterface );
}
// The copy constructor and operator are left unimplemented.
-#ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_H__
-#define __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#ifndef DALI_TOOLKIT_TEXT_CONTROLLER_H
+#define DALI_TOOLKIT_TEXT_CONTROLLER_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
-#include <dali-toolkit/internal/text/text-control-interface.h>
namespace Dali
{
{
class Controller;
+class ControlInterface;
+class EditableControlInterface;
class View;
typedef IntrusivePtr<Controller> ControllerPtr;
-typedef Dali::Toolkit::Text::ControlInterface ControlInterface;
/**
* @brief A Text Controller is used by UI Controls which display text.
/**
* @brief Create a new instance of a Controller.
*
- * @param[in] controlInterface An interface used to request a text relayout.
* @return A pointer to a new Controller.
*/
- static ControllerPtr New( ControlInterface& controlInterface );
+ static ControllerPtr New();
+
+ /**
+ * @brief Create a new instance of a Controller.
+ *
+ * @param[in] controlInterface The control's interface.
+ *
+ * @return A pointer to a new Controller.
+ */
+ static ControllerPtr New( ControlInterface* controlInterface );
+
+ /**
+ * @brief Create a new instance of a Controller.
+ *
+ * @param[in] controlInterface The control's interface.
+ * @param[in] editableControlInterface The editable control's interface.
+ *
+ * @return A pointer to a new Controller.
+ */
+ static ControllerPtr New( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface );
public: // Configure the text controller.
/**
* @brief Private constructor.
*/
- Controller( ControlInterface& controlInterface );
+ Controller();
+
+ /**
+ * @brief Private constructor.
+ */
+ Controller( ControlInterface* controlInterface );
+
+ /**
+ * @brief Private constructor.
+ */
+ Controller( ControlInterface* controlInterface,
+ EditableControlInterface* editableControlInterface );
// Undefined
Controller( const Controller& handle );
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__
+#endif // DALI_TOOLKIT_TEXT_CONTROLLER_H
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H
+#define DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H
+
+/*
+ * Copyright (c) 2016 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/internal/text/input-style.h>
+
+namespace Dali
+{
+
+class Actor;
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief An interface that the Text::Controller uses to notify about text changes and add decoration to the text control.
+ */
+class EditableControlInterface
+{
+public:
+
+ /**
+ * @brief Virtual destructor.
+ */
+ virtual ~EditableControlInterface()
+ {}
+
+ /**
+ * @brief Called to signal that text has been inserted or deleted.
+ */
+ virtual void TextChanged() = 0;
+
+ /**
+ * @brief Called when the number of characters to be inserted exceeds the maximum limit
+ */
+ virtual void MaxLengthReached() = 0;
+
+ /**
+ * @brief Called to signal that input style has been changed.
+ *
+ * @param[in] inputStyleMask Mask with the bits of the input style that has changed.
+ */
+ virtual void InputStyleChanged( InputStyle::Mask inputStyleMask ) = 0;
+
+ /**
+ * @brief Add a decoration.
+ *
+ * @param[in] decoration The actor displaying a decoration.
+ * @param[in] needsClipping Whether the actor needs clipping.
+ */
+ virtual void AddDecoration( Actor& actor, bool needsClipping ) = 0;
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_EDITABLE_CONTROL_INTERFACE_H
if( lastLine.ellipsis )
{
+ if( ( 1u == numberOfLines ) &&
+ ( lastLine.ascender - lastLine.descender > mImpl->mVisualModel->mControlSize.height ) )
+ {
+ // Get the first glyph which is going to be replaced and the ellipsis glyph.
+ GlyphInfo& glyphInfo = *glyphs;
+ const GlyphInfo& ellipsisGlyph = mImpl->mFontClient.GetEllipsisGlyph( mImpl->mFontClient.GetPointSize( glyphInfo.fontId ) );
+
+ // Change the 'x' and 'y' position of the ellipsis glyph.
+ Vector2& position = *glyphPositions;
+ position.x = ellipsisGlyph.xBearing;
+ position.y = mImpl->mVisualModel->mControlSize.height - ellipsisGlyph.yBearing;
+
+ // Replace the glyph by the ellipsis glyph.
+ glyphInfo = ellipsisGlyph;
+
+ return 1u;
+ }
+
// firstPenX, penY and firstPenSet are used to position the ellipsis glyph if needed.
float firstPenX = 0.f; // Used if rtl text is elided.
float penY = 0.f;
#include <dali/integration-api/debug.h>
//INTERNAL HEARDER
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
{
+
Property::Value* customShaderValue = propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
if( customShaderValue )
{
}
}
+ Property::Value* premultipliedAlphaValue = propertyMap.Find( Toolkit::DevelVisual::Property::PREMULTIPLIED_ALPHA, PREMULTIPLIED_ALPHA );
+ if( premultipliedAlphaValue )
+ {
+ bool premultipliedAlpha( false );
+ if( premultipliedAlphaValue->Get( premultipliedAlpha ) )
+ {
+ EnablePreMultipliedAlpha( premultipliedAlpha );
+ }
+ }
+
DoInitialize( actor, propertyMap );
}
void Base::EnablePreMultipliedAlpha( bool preMultipled )
{
- if(preMultipled)
+ if( preMultipled )
{
mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
}
{
mImpl->mCustomShader->CreatePropertyMap( map );
}
+
+ bool premultipliedAlpha( IsPreMultipliedAlphaEnabled() );
+ map.Insert( DevelVisual::Property::PREMULTIPLIED_ALPHA, premultipliedAlpha );
}
bool Base::GetIsOnStage() const
const char * const CUSTOM_SUBDIVIDE_GRID_Y( "subdivideGridY" );
const char * const CUSTOM_SHADER_HINTS( "hints" );
+// Premultipled alpha
+extern const char * const PREMULTIPLIED_ALPHA( "premultipliedAlpha" );
+
// Image visual
const char * const IMAGE_URL_NAME("url");
const char * const ATLAS_RECT_UNIFORM_NAME ( "uAtlasRect" );
extern const char * const CUSTOM_SUBDIVIDE_GRID_Y;
extern const char * const CUSTOM_SHADER_HINTS;
+// Premultiplied alpha
+extern const char * const PREMULTIPLIED_ALPHA;
+
// Image visual
extern const char * const IMAGE_URL_NAME;
extern const char * const ATLAS_RECT_UNIFORM_NAME;
*/
// CLASS HEADER
-
#include <dali-toolkit/public-api/controls/buttons/button.h>
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/buttons/button-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
void Button::SetDisabled( bool disabled )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabled() is deprecated and will be removed from next release. Use SetProperty DISABLED or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled );
}
bool Button::IsDisabled() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsDisabled() is deprecated and will be removed from next release. Use GetProperty DISABLED instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).IsDisabled();
}
void Button::SetAutoRepeating( bool autoRepeating )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetAutoRepeating() is deprecated and will be removed from next release. Use SetProperty AUTO_REPEATING or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
}
bool Button::IsAutoRepeating() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsAutoRepeating() is deprecated and will be removed from next release. Use GetProperty AUTO_REPEATING instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
}
void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
}
float Button::GetInitialAutoRepeatingDelay() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
}
void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetNextAutoRepeatingDelay() is deprecated and will be removed from next release. Use SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
}
float Button::GetNextAutoRepeatingDelay() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetNextAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty NEXT_AUTO_REPEATING_DELAY instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
}
void Button::SetTogglableButton( bool togglable )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetTogglableButton() is deprecated and will be removed from next release. Use SetProperty TOGGLABLE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetTogglableButton( togglable );
}
bool Button::IsTogglableButton() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsTogglableButton() is deprecated and will be removed from next release. Use GetProperty TOGGLABLE instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).IsTogglableButton();
}
void Button::SetSelected( bool selected )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelected() is deprecated and will be removed from next release. Use SetProperty SELECTED instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetSelected( selected );
}
bool Button::IsSelected() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsSelected() is deprecated and will be removed from next release. Use GetProperty SELECTED instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).IsSelected();
}
void Button::SetAnimationTime( float animationTime )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetAnimationTime() is deprecated and will be removed from next release. Use Styling file to set animation instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetAnimationTime( animationTime );
}
float Button::GetAnimationTime() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetAnimationTime() is deprecated and will be removed from next release.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime();
}
void Button::SetLabelText( const std::string& label )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetLabelText() is deprecated and will be removed from next release. Use SetProperty LABEL or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetLabelText( label );
}
std::string Button::GetLabelText() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetLabelText() is deprecated and will be removed from next release. Use GetProperty LABEL instead.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
}
void Button::SetUnselectedImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetUnselectedImage() is deprecated and will be removed from next release. Use SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetUnselectedImage( filename );
}
void Button::SetBackgroundImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( filename );
}
void Button::SetSelectedImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( filename );
}
void Button::SetSelectedBackgroundImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( filename );
}
void Button::SetDisabledBackgroundImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release. Use SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( filename );
}
void Button::SetDisabledImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( filename );
}
void Button::SetDisabledSelectedImage( const std::string& filename )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( filename );
}
void Button::SetLabel( Actor label )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetLabel() is deprecated and will be removed from next release. Use SetProperty LABEL instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
}
void Button::SetButtonImage( Image image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
Actor imageView = Toolkit::ImageView::New( image );
imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageView );
void Button::SetSelectedImage( Image image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
+
Actor imageView = Toolkit::ImageView::New( image );
imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageView );
Actor Button::GetButtonImage() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetButtonImage() is deprecated and will be removed from next release.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
}
Actor Button::GetSelectedImage() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetSelectedImage() is deprecated and will be removed from next release.\n" );
+
return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
}
* @SINCE_1_0.0
* @param[in] disabled property.
*/
- void SetDisabled( bool disabled );
+ void SetDisabled( bool disabled ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use GetProperty DISABLED
* @SINCE_1_0.0
* @return \e true if the button is \e disabled.
*/
- bool IsDisabled() const;
+ bool IsDisabled() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 SetProperty AUTO_REPEATING or Styling file
* @SINCE_1_0.0
* @param[in] autoRepeating \e autorepeating property.
*/
- void SetAutoRepeating( bool autoRepeating );
+ void SetAutoRepeating( bool autoRepeating ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 GetProperty AUTO_REPEATING
* @SINCE_1_0.0
* @return \e true if the \e autorepeating property is set.
*/
- bool IsAutoRepeating() const;
+ bool IsAutoRepeating() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file
* @param[in] initialAutoRepeatingDelay in seconds.
* @pre initialAutoRepeatingDelay must be greater than zero.
*/
- void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay );
+ void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 GetProperty INITIAL_AUTO_REPEATING_DELAY
* @SINCE_1_0.0
* @return the initial autorepeating delay in seconds.
*/
- float GetInitialAutoRepeatingDelay() const;
+ float GetInitialAutoRepeatingDelay() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file
* @param[in] nextAutoRepeatingDelay in seconds.
* @pre nextAutoRepeatingDelay must be greater than zero.
*/
- void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay );
+ void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 GetProperty NEXT_AUTO_REPEATING_DELAY
* @SINCE_1_0.0
* @return the next autorepeating delay in seconds.
*/
- float GetNextAutoRepeatingDelay() const;
+ float GetNextAutoRepeatingDelay() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 SetProperty TOGGLABLE or Styling file
* @SINCE_1_0.0
* @param[in] togglable property.
*/
- void SetTogglableButton( bool togglable );
+ void SetTogglableButton( bool togglable ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 GetProperty TOGGLABLE
* @SINCE_1_0.0
* @return \e true if the \e togglable property is set.
*/
- bool IsTogglableButton() const;
+ bool IsTogglableButton() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 SetProperty SELECTED
* @SINCE_1_0.0
* @param[in] selected property.
*/
- void SetSelected( bool selected );
+ void SetSelected( bool selected ) DALI_DEPRECATED_API;
/**
- * DEPRECATED_1_1.32 SetProperty SELECTED
+ * DEPRECATED_1_1.32 GetProperty SELECTED
*
* @brief Returns if the selected property is set and the button is togglable.
* @SINCE_1_0.0
* @return \e true if the button is \e selected.
*/
- bool IsSelected() const;
+ bool IsSelected() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use Styling file to set animation
* @SINCE_1_0.0
* @param[in] animationTime The animation time in seconds.
*/
- void SetAnimationTime( float animationTime );
+ void SetAnimationTime( float animationTime ) DALI_DEPRECATED_API;
/**
* DEPRECATED_1_1.32 Use Styling file to set animation
* @SINCE_1_0.0
* @return The animation time in seconds.
*/
- float GetAnimationTime() const;
+ float GetAnimationTime() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 SetProperty LABEL or Styling file
* @SINCE_1_0.0
* @param[in] label The label text.
*/
- void SetLabelText( const std::string& label );
+ void SetLabelText( const std::string& label ) DALI_DEPRECATED_API;
/**
* DEPRECATED_1_1.32 GetProperty LABEL
* @SINCE_1_0.0
* @return The label text.
*/
- std::string GetLabelText() const;
+ std::string GetLabelText() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use Styling file
* @SINCE_1_0.0
* @param[in] filename The button image.
*/
- void SetUnselectedImage( const std::string& filename );
+ void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use styling
* @SINCE_1_0.0
* @param[in] filename The background image.
*/
- void SetBackgroundImage( const std::string& filename );
+ void SetBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use styling file
* @SINCE_1_0.0
* @param[in] filename The selected image.
*/
- void SetSelectedImage( const std::string& filename );
+ void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use styling file
* @SINCE_1_0.0
* @param[in] filename The selected background image.
*/
- void SetSelectedBackgroundImage( const std::string& filename );
+ void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use styling file
* @SINCE_1_0.0
* @param[in] filename The disabled background image.
*/
- void SetDisabledBackgroundImage( const std::string& filename );
+ void SetDisabledBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use styling file
* @SINCE_1_0.0
* @param[in] filename The disabled button image.
*/
- void SetDisabledImage( const std::string& filename );
+ void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.32 Use styling file
* @SINCE_1_0.0
* @param[in] filename The disabled selected button image.
*/
- void SetDisabledSelectedImage( const std::string& filename );
+ void SetDisabledSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_0.50. Instead, use SetLabelText.
* @SINCE_1_0.0
* @param[in] label The actor to use as a label
*/
- void SetLabel( Actor label );
+ void SetLabel( Actor label ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_0.50. Instead, use SetUnselectedImage.
* @SINCE_1_0.0
* @param[in] image The button image.
*/
- void SetButtonImage( Image image );
+ void SetButtonImage( Image image ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_0.50. Instead, use SetSelectedImage( const std::string& filename ).
* @SINCE_1_0.0
* @param[in] image The selected image.
*/
- void SetSelectedImage( Image image );
+ void SetSelectedImage( Image image ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_0.50
* @remarks Avoid using this method as it's a legacy code.
* @return An actor with the button image.
*/
- Actor GetButtonImage() const;
+ Actor GetButtonImage() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_0.50
* @remarks Avoid using this method as it's a legacy code.
* @return An actor with the selected image.
*/
- Actor GetSelectedImage() const;
+ Actor GetSelectedImage() const DALI_DEPRECATED_API;
public: //Signals
*/
// CLASS HEADER
-
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
namespace Dali
void PushButton::SetButtonImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
}
void PushButton::SetBackgroundImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
}
void PushButton::SetSelectedImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
}
void PushButton::SetSelectedBackgroundImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image );
}
void PushButton::SetDisabledBackgroundImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
}
void PushButton::SetDisabledImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
}
void PushButton::SetDisabledSelectedImage( Actor image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
+
Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image );
}
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetButtonImage( Actor image );
+ void SetButtonImage( Actor image ) DALI_DEPRECATED_API;
using Button::SetBackgroundImage;
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetBackgroundImage( Actor image );
+ void SetBackgroundImage( Actor image ) DALI_DEPRECATED_API;
using Button::SetSelectedImage;
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetSelectedImage( Actor image );
+ void SetSelectedImage( Actor image ) DALI_DEPRECATED_API;
using Button::SetSelectedBackgroundImage;
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetSelectedBackgroundImage( Actor image );
+ void SetSelectedBackgroundImage( Actor image ) DALI_DEPRECATED_API;
using Button::SetDisabledBackgroundImage;
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetDisabledBackgroundImage( Actor image );
+ void SetDisabledBackgroundImage( Actor image ) DALI_DEPRECATED_API;
using Button::SetDisabledImage;
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetDisabledImage( Actor image );
+ void SetDisabledImage( Actor image ) DALI_DEPRECATED_API;
using Button::SetDisabledSelectedImage;
* @SINCE_1_0.0
* @param[in] image The Actor to use.
*/
- void SetDisabledSelectedImage( Actor image );
+ void SetDisabledSelectedImage( Actor image ) DALI_DEPRECATED_API;
public: // Not intended for application developers
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/styling/style-manager-impl.h>
#include <dali-toolkit/internal/visuals/color/color-visual.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
namespace Dali
{
void Control::SetBackground( const Property::Map& map )
{
Actor self( Self() );
- InitializeVisual( self, mImpl->mBackgroundVisual, map );
- if( mImpl->mBackgroundVisual )
+ Toolkit::Visual::Base backgroundVisual;
+ InitializeVisual( self, backgroundVisual, map );
+
+ // if new visual created, replace existing one
+ if( backgroundVisual )
{
+ mImpl->mBackgroundVisual = backgroundVisual;
mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
}
+ // ...otherwise process map and apply it to the existing visual
+ else if( mImpl->mBackgroundVisual )
+ {
+ Property::Value* premultipliedAlpha = map.Find( Toolkit::DevelVisual::Property::PREMULTIPLIED_ALPHA, Toolkit::Internal::PREMULTIPLIED_ALPHA );
+ if( premultipliedAlpha )
+ {
+ bool value( premultipliedAlpha->Get<bool>() );
+ Toolkit::GetImplementation( mImpl->mBackgroundVisual ).EnablePreMultipliedAlpha( value );
+ }
+ }
}
void Control::SetBackgroundImage( Image image )
void Control::OnControlChildAdd( Actor& child )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: OnControlChildAdd() is deprecated and will be removed from next release. Override OnChildAdd instead.\n" );
}
void Control::OnControlChildRemove( Actor& child )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: OnControlChildRemove() is deprecated and will be removed from next release. Override OnChildRemove instead.\n" );
}
void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
* @SINCE_1_0.0
* @param[in] child The added actor.
*/
- virtual void OnControlChildAdd( Actor& child );
+ virtual void OnControlChildAdd( Actor& child ) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.30. Override OnChildRemove instead.
* @SINCE_1_0.0
* @param[in] child The removed actor.
*/
- virtual void OnControlChildRemove( Actor& child );
+ virtual void OnControlChildRemove( Actor& child ) DALI_DEPRECATED_API;
// Styling
// CLASS HEADER
#include <dali-toolkit/public-api/controls/control.h>
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
void Control::SetBackgroundColor( const Vector4& color )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
+
Internal::GetImplementation(*this).SetBackgroundColor( color );
}
Vector4 Control::GetBackgroundColor() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
+
return Internal::GetImplementation(*this).GetBackgroundColor();
}
* @SINCE_1_0.0
* @return The background color of the control.
*/
- Vector4 GetBackgroundColor() const;
+ Vector4 GetBackgroundColor() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_2_8, use Property::BACKGROUND instead
* @SINCE_1_0.0
* @param[in] image The image to set as the background.
*/
- void SetBackgroundImage( Image image );
+ void SetBackgroundImage( Image image ) DALI_DEPRECATED_API;
/**
* @brief Clears the background.
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/property-map.h>
ImageView ImageView::New( Image image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: New() is deprecated and will be removed from next release. use New( const std::string& ) instead.\n" );
+
ImageView imageView = Internal::ImageView::New();
imageView.SetImage( image );
return imageView;
void ImageView::SetImage( Image image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetImage() is deprecated and will be removed from next release. Use SetImage( const std::string& ) instead.\n" );
+
Dali::Toolkit::GetImpl( *this ).SetImage( image );
}
Image ImageView::GetImage() const
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetImage() is deprecated and will be removed from next release.\n" );
+
return Dali::Toolkit::GetImpl( *this ).GetImage();
}
* @param[in] image The Image instance to display.
* @return A handle to a newly allocated ImageView.
*/
- static ImageView New( Image image );
+ static ImageView New( Image image ) DALI_DEPRECATED_API;
/**
* @brief Create an initialized ImageView from an URL to an image resource.
* @SINCE_1_0.0
* @param[in] image The Image instance to display.
*/
- void SetImage( Image image );
+ void SetImage( Image image ) DALI_DEPRECATED_API;
/**
* @brief Sets this ImageView from the given URL.
* @SINCE_1_0.0
* @return The Image instance currently used by the ImageView.
*/
- Image GetImage() const;
+ Image GetImage() const DALI_DEPRECATED_API;
public: // Not intended for application developers