bool GetLogicalCursorIndexTest( const GetLogicalCursorIndexData& data )
{
- std::cout << " testing : " << data.description << std::endl;
+ tet_printf( " testing : %s\n", data.description.c_str() );
// Load some fonts.
TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
if( logicalModel->mBidirectionalLineIndex != data.cachedBidiLine[index] )
{
- std::cout << " test : " << index << ", different cached line index : " << logicalModel->mBidirectionalLineIndex << ", expected : " << data.cachedBidiLine[index] << std::endl;
+ tet_printf( " test : %d, different cached line index : %d, expected : %d\n", index, logicalModel->mBidirectionalLineIndex, data.cachedBidiLine[index] );
return false;
}
if( logicalCursorIndex != data.logicalCursorIndex[index] )
{
- std::cout << " test : " << index << ", visual index : " << visualCharacterIndex << ", different logical cursor index : " << logicalCursorIndex << ", expected : " << data.logicalCursorIndex[index] << std::endl;
+ tet_printf( " test : %d, visual index : %d, different logical cursor index :%d, expected : %d", index, visualCharacterIndex, logicalCursorIndex, data.logicalCursorIndex[index] );
return false;
}
}
controller->GetText( text );
DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION );
+ // for coverage
+ inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::UNDERLINE );
+
// Send PRE_EDIT event
imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "wo", 6, 2 );
controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
const std::string& GetSurroundingText() const;
void ApplyOptions( const InputMethodOptions& options );
bool FilterEventKey( const Dali::KeyEvent& keyEvent );
+ void SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type );
+ Dali::InputMethodContext::PreeditStyle GetPreeditStyle() const;
public: // Signals
ActivatedSignalType& ActivatedSignal() { return mActivatedSignal; }
bool mRestoreAfterFocusLost:1; ///< Whether the keyboard needs to be restored (activated ) after focus regained.
bool mIdleCallbackConnected:1; ///< Whether the idle callback is already connected.
InputMethodOptions mOptions;
+ Dali::InputMethodContext::PreeditStyle mPreeditStyle;
ActivatedSignalType mActivatedSignal;
KeyboardEventSignalType mEventSignal;
: mIMFCursorPosition( 0 ),
mSurroundingText(),
mRestoreAfterFocusLost( false ),
- mIdleCallbackConnected( false )
+ mIdleCallbackConnected( false ),
+ mPreeditStyle( Dali::InputMethodContext::PreeditStyle::NONE )
{
CreateContext( /*ecoreXwin*/ );
ConnectCallbacks();
{
return false;
}
+
+void InputMethodContext::SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type )
+{
+ mPreeditStyle = type;
+}
+
+Dali::InputMethodContext::PreeditStyle InputMethodContext::GetPreeditStyle() const
+{
+ return mPreeditStyle;
+}
} // Adaptor
} // Internal
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
}
+void InputMethodContext::SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type )
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetPreeditStyle( type );
+}
+
+Dali::InputMethodContext::PreeditStyle InputMethodContext::GetPreeditStyle() const
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle();
+}
+
+// Signals
InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
{
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
public:
/**
- * @brief Events that are generated by the input method context.
+ * @brief The direction of text.
+ */
+ enum TextDirection
+ {
+ LeftToRight,
+ RightToLeft,
+ };
+
+ /**
+ * @brief Events that are generated by the InputMethodContext.
*/
enum EventType
{
};
/**
- * @brief This structure is used to pass on data from the input method cotext regarding predictive text.
+ * @brief Enumeration for state of the input panel.
+ */
+ enum State
+ {
+ DEFAULT = 0, ///< Unknown state
+ SHOW, ///< Input panel is shown
+ HIDE, ///< Input panel is hidden
+ WILL_SHOW ///< Input panel in process of being shown
+ };
+
+ /**
+ * @brief Enumeration for the type of Keyboard.
+ */
+ enum KeyboardType
+ {
+ SOFTWARE_KEYBOARD, ///< Software keyboard (Virtual keyboard) is default
+ HARDWARE_KEYBOARD ///< Hardware keyboard
+ };
+
+ /**
+ * @brief Enumeration for the language mode of the input panel.
+ */
+ enum class InputPanelLanguage
+ {
+ AUTOMATIC, ///< IME Language automatically set depending on the system display
+ ALPHABET ///< Latin alphabet at all times
+ };
+
+ /**
+ * @brief Enumeration for the preedit style types.
+ */
+ enum class PreeditStyle
+ {
+ NONE, ///< None style
+ UNDERLINE, ///< Underline substring style
+ REVERSE, ///< Reverse substring style
+ HIGHLIGHT ///< Highlight substring style
+ };
+
+ /**
+ * @brief This structure is used to pass on data from the InputMethodContext regarding predictive text.
*/
struct EventData
{
*/
bool FilterEventKey( const Dali::KeyEvent& keyEvent );
+ /**
+ * @brief Sets the preedit type.
+ *
+ * @param[in] type The preedit style type
+ */
+ void SetPreeditStyle( PreeditStyle type );
+
+ /**
+ * @brief Gets the preedit type.
+ *
+ * @return The preedit style type
+ */
+ PreeditStyle GetPreeditStyle() const;
+
public:
// Signals
virtual ~Window() = default;
static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent);
FocusChangeSignalType mFocusChangeSignal;
+ DevelWindow::VisibilityChangedSignalType mVisibilityChangedSignal;
};
} // namespace Adaptor
{
Window::Window( const PositionSize& positionSize )
-: SceneHolder( positionSize )
+: SceneHolder( positionSize ),
+ mFocusChangeSignal(),
+ mVisibilityChangedSignal()
{
}
GetImplementation( *this ).mFocusChangeSignal.Emit(*this, true);
}
+void Window::Hide()
+{
+ GetImplementation( *this ).mVisibilityChangedSignal.Emit( *this, false );
+}
+
FocusChangeSignalType& Window::FocusChangeSignal()
{
return GetImplementation( *this ).mFocusChangeSignal;
return GetImplementation( window ).WheelEventSignal();
}
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
+{
+ return GetImplementation( window ).mVisibilityChangedSignal;
+}
+
} // namespace DevelWindow
} // Dali
void SetBackgroundColor( const Vector4& color );
Vector4 GetBackgroundColor() const;
void Raise();
+ void Hide();
FocusChangeSignalType& FocusChangeSignal();
public:
typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;
typedef Signal< void (const TouchData&) > TouchSignalType;
typedef Signal< void (const WheelEvent&) > WheelEventSignalType;
+typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType;
Dali::Window Get( Actor actor );
Dali::Window DownCast( BaseHandle handle );
KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Window window );
TouchSignalType& TouchSignal( Dali::Window window );
WheelEventSignalType& WheelEventSignal( Window window );
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window );
}
} // namespace Dali
#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h>
#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
#include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include "dummy-control.h"
using namespace Dali;
END_TEST;
}
-int UtcDaliAnimatedVectorImageVisualVisibilityChanged(void)
+int UtcDaliAnimatedVectorImageVisualControlVisibilityChanged(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualVisibilityChanged" );
+ tet_infoline( "UtcDaliAnimatedVectorImageVisualControlVisibilityChanged" );
Property::Map propertyMap;
propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
END_TEST;
}
+
+int UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged" );
+
+ Property::Map propertyMap;
+ propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
+ .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
+
+ DummyControl actor = DummyControl::New( true );
+ DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+ Vector2 controlSize( 20.f, 30.f );
+ actor.SetSize( controlSize );
+
+ Stage::GetCurrent().Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ Property::Map attributes;
+ DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+
+ // Check rendering behavior
+ DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ Renderer renderer = actor.GetRendererAt( 0u );
+ DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::CONTINUOUSLY );
+
+ Window window = DevelWindow::Get( actor );
+ window.Hide();
+
+ application.SendNotification();
+ application.Render();
+
+ // Check rendering behavior again
+ DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::IF_REQUIRED );
+
+ END_TEST;
+}
// Don't render outline for other styles
outlineWidth = 0.0f;
}
+
if( style != Typesetter::STYLE_UNDERLINE )
{
fontClient.CreateBitmap( glyphInfo->fontId,
static_cast<int>( outlineWidth ) );
}
-
// Sets the glyph's bitmap into the bitmap of the whole text.
if( NULL != glyphData.glyphBitmap.buffer )
{
+ if ( style == Typesetter::STYLE_OUTLINE )
+ {
+ // Set the position offset for the current glyph
+ glyphData.horizontalOffset -= glyphData.glyphBitmap.outlineOffsetX;
+ glyphData.verticalOffset -= glyphData.glyphBitmap.outlineOffsetY;
+ }
+
+ // Set the buffer of the glyph's bitmap into the final bitmap's buffer
TypesetGlyph( glyphData,
position,
&color,
style,
pixelFormat);
+
+ if ( style == Typesetter::STYLE_OUTLINE )
+ {
+ // Reset the position offset for the next glyph
+ glyphData.horizontalOffset += glyphData.glyphBitmap.outlineOffsetX;
+ glyphData.verticalOffset += glyphData.glyphBitmap.outlineOffsetY;
+ }
+
// delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer
delete []glyphData.glyphBitmap.buffer;
glyphData.glyphBitmap.buffer = NULL;
mEventData->mPreEditFlag &&
( 0u != mModel->mVisualModel->mCharactersToGlyph.Count() ) )
{
- // Add the underline for the pre-edit text.
- const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin();
- const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin();
+ Dali::InputMethodContext::PreeditStyle type = mEventData->mInputMethodContext.GetPreeditStyle();
- const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition );
- const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u );
- const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter );
- const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u );
+ switch( type )
+ {
+ case Dali::InputMethodContext::PreeditStyle::UNDERLINE:
+ {
+ // Add the underline for the pre-edit text.
+ const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin();
+ const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin();
- GlyphRun underlineRun;
- underlineRun.glyphIndex = glyphStart;
- underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart;
+ const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition );
+ const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u );
+ const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter );
+ const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u );
- // TODO: At the moment the underline runs are only for pre-edit.
- mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun );
+ GlyphRun underlineRun;
+ underlineRun.glyphIndex = glyphStart;
+ underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart;
+
+ mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun );
+ break;
+ }
+ // TODO : At this moment, other styles for preedit are not implemented yet.
+ case Dali::InputMethodContext::PreeditStyle::REVERSE:
+ case Dali::InputMethodContext::PreeditStyle::HIGHLIGHT:
+ case Dali::InputMethodContext::PreeditStyle::NONE:
+ default:
+ break;
+ }
}
// The estimated number of lines. Used to avoid reallocations when layouting.
// EXTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
mSizeNotification = actor.AddPropertyNotification( Actor::Property::SIZE, StepCondition( 3.0f ) );
mSizeNotification.NotifySignal().Connect( this, &AnimatedVectorImageVisual::OnSizeNotification );
- DevelActor::VisibilityChangedSignal( actor ).Connect( this, &AnimatedVectorImageVisual::OnVisibilityChanged );
+ DevelActor::VisibilityChangedSignal( actor ).Connect( this, &AnimatedVectorImageVisual::OnControlVisibilityChanged );
+
+ Window window = DevelWindow::Get( actor );
+ if( window )
+ {
+ DevelWindow::VisibilityChangedSignal( window ).Connect( this, &AnimatedVectorImageVisual::OnWindowVisibilityChanged );
+ }
DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::DoSetOnStage [%p]\n", this );
}
void AnimatedVectorImageVisual::DoSetOffStage( Actor& actor )
{
- mVectorAnimationTask->PauseAnimation();
-
- mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE;
+ PauseAnimation();
if( mImpl->mRenderer )
{
- mImpl->mRenderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED );
-
actor.RemoveRenderer( mImpl->mRenderer );
mImpl->mRenderer.Reset();
actor.RemovePropertyNotification( mScaleNotification );
actor.RemovePropertyNotification( mSizeNotification );
- DevelActor::VisibilityChangedSignal( actor ).Connect( this, &AnimatedVectorImageVisual::OnVisibilityChanged );
+ DevelActor::VisibilityChangedSignal( actor ).Disconnect( this, &AnimatedVectorImageVisual::OnControlVisibilityChanged );
+
+ Window window = DevelWindow::Get( actor );
+ if( window )
+ {
+ DevelWindow::VisibilityChangedSignal( window ).Disconnect( this, &AnimatedVectorImageVisual::OnWindowVisibilityChanged );
+ }
mPlacementActor.Reset();
}
}
+void AnimatedVectorImageVisual::PauseAnimation()
+{
+ if( mActionStatus == DevelAnimatedVectorImageVisual::Action::PLAY )
+ {
+ mVectorAnimationTask->PauseAnimation();
+
+ mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE;
+
+ if( mImpl->mRenderer )
+ {
+ mImpl->mRenderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED );
+ }
+ }
+}
+
void AnimatedVectorImageVisual::OnScaleNotification( PropertyNotification& source )
{
Actor actor = mPlacementActor.GetHandle();
}
}
-void AnimatedVectorImageVisual::OnVisibilityChanged( Actor actor, bool visible, DevelActor::VisibilityChange::Type type )
+void AnimatedVectorImageVisual::OnControlVisibilityChanged( Actor actor, bool visible, DevelActor::VisibilityChange::Type type )
{
if( !visible )
{
- if( mActionStatus == DevelAnimatedVectorImageVisual::Action::PLAY )
- {
- mVectorAnimationTask->PauseAnimation();
+ PauseAnimation();
- if( mImpl->mRenderer )
- {
- mImpl->mRenderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED );
- }
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnControlVisibilityChanged: invisibile. Pause animation [%p]\n", this );
+ }
+}
- mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE;
+void AnimatedVectorImageVisual::OnWindowVisibilityChanged( Window window, bool visible )
+{
+ if( !visible )
+ {
+ PauseAnimation();
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnVisibilityChanged: invisibile. Pause animation [%p]\n", this );
- }
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnWindowVisibilityChanged: invisibile. Pause animation [%p]\n", this );
}
}
#include <dali/public-api/object/weak-handle.h>
#include <dali/public-api/object/property-notification.h>
#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/public-api/adaptor-framework/window.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
void SetVectorImageSize();
/**
+ * @brief Pause the animation.
+ */
+ void PauseAnimation();
+
+ /**
* @brief Callback when the world scale factor changes.
*/
void OnScaleNotification( PropertyNotification& source );
/**
* @brief Callback when the visibility of the actor is changed.
*/
- void OnVisibilityChanged( Actor actor, bool visible, DevelActor::VisibilityChange::Type type );
+ void OnControlVisibilityChanged( Actor actor, bool visible, DevelActor::VisibilityChange::Type type );
+
+ /**
+ * @brief Callback when the visibility of the window is changed.
+ */
+ void OnWindowVisibilityChanged( Window window, bool visible );
// Undefined
AnimatedVectorImageVisual( const AnimatedVectorImageVisual& visual ) = delete;
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 4;
-const unsigned int TOOLKIT_MICRO_VERSION = 42;
+const unsigned int TOOLKIT_MICRO_VERSION = 43;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.4.42
+Version: 1.4.43
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
BuildRequires: pkgconfig(dali-adaptor)
BuildRequires: gettext
BuildRequires: pkgconfig(libtzplatform-config)
+Provides: libdali-toolkit-cxx11.so
+Provides: libdali-toolkit-cxx11.so.0
+Provides: libdali-toolkit-cxx11.so.0.0.0
#############################
# profile setup