本文整理汇总了C++中ToolkitTestApplication::SendNotification方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolkitTestApplication::SendNotification方法的具体用法?C++ ToolkitTestApplication::SendNotification怎么用?C++ ToolkitTestApplication::SendNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolkitTestApplication
的用法示例。
在下文中一共展示了ToolkitTestApplication::SendNotification方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UtcDaliPushButtonPressed
static void UtcDaliPushButtonPressed()
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliPushButtonPressed");
PushButton pushButton = PushButton::New();
pushButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
pushButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
pushButton.SetPosition( 240, 400 );
pushButton.SetSize( 100, 100 );
Stage::GetCurrent().Add( pushButton );
application.SendNotification();
application.Render();
gPushButtonPressed = false;
// connect to its touch signal
pushButton.PressedSignal().Connect( &PushButtonPressed );
Dali::Integration::TouchEvent eventDown;
eventDown.AddPoint( pointDownInside );
// flush the queue and render once
application.SendNotification();
application.Render();
application.ProcessEvent( eventDown );
DALI_TEST_CHECK( gPushButtonPressed );
}
示例2: UtcDaliMagnifierSetSourceActorP
int UtcDaliMagnifierSetSourceActorP(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
RenderTaskList renderTaskList = stage.GetRenderTaskList();
DALI_TEST_CHECK( renderTaskList.GetTaskCount() > 1 );
Actor actor = Actor::New();
stage.Add( actor );
DALI_TEST_CHECK( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor() != actor );
view.SetSourceActor( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor(), actor, TEST_LOCATION );
END_TEST;
}
示例3: UtcDaliMagnifierFrameVisibility
int UtcDaliMagnifierFrameVisibility(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, false );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, true );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
END_TEST;
}
示例4: UtcDaliControlImplStyleChange
int UtcDaliControlImplStyleChange(void)
{
ToolkitTestApplication application;
DummyControl dummy = DummyControl::New( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
// Add a Control and normal Actor as children
DummyControl dummyChild = DummyControl::New();
dummy.Add(dummyChild);
Actor actor = Actor::New();
dummy.Add(actor);
DALI_TEST_EQUALS( dummyImpl.styleChangeCalled, false, TEST_LOCATION );
StyleChange styleChange;
styleChange.defaultFontChange = true;
Dali::StyleMonitor styleMonitor = application.GetAdaptor().GetToolkitStyleMonitor();
styleMonitor.EmitStyleChangeSignal(styleChange);
DALI_TEST_EQUALS( dummyImpl.styleChangeCalled, true, TEST_LOCATION );
Stage::GetCurrent().Remove(dummy);
END_TEST;
}
示例5: utcDaliTextFieldEvent03
int utcDaliTextFieldEvent03(void)
{
ToolkitTestApplication application;
tet_infoline(" utcDaliTextFieldEvent03");
// Checks if the highlight actor is created.
TextField field = TextField::New();
DALI_TEST_CHECK( field );
Stage::GetCurrent().Add( field );
field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
field.SetSize( 30.f, 50.f );
field.SetParentOrigin( ParentOrigin::TOP_LEFT );
field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
// Render and notify
application.SendNotification();
application.Render();
// Tap first to get the focus.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
// Render and notify
application.SendNotification();
application.Render();
// Double tap to select a word.
application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
// Render and notify
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 );
Renderer renderer = offscreenRoot.GetChildAt( 1u ).GetRendererAt( 0u );
DALI_TEST_CHECK( renderer );
Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
DALI_TEST_CHECK( highlight );
END_TEST;
}
示例6: UtcDaliDisplacementEffectTestSetProperty
// Positive test case for a method
int UtcDaliDisplacementEffectTestSetProperty(void)
{
ToolkitTestApplication application;
tet_infoline("UtcDaliDisplacementEffectTestSetProperty");
Toolkit::DisplacementEffect effect = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::DISPLACED);
DALI_TEST_CHECK( effect );
ImageActor actor = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
actor.SetSize( 100.0f, 100.0f );
actor.SetShaderEffect( effect );
Stage::GetCurrent().Add( actor );
Toolkit::DisplacementEffect effect2 = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::FIXED);
DALI_TEST_CHECK( effect );
ImageActor actor2 = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
actor2.SetSize( 100.0f, 100.0f );
actor2.SetShaderEffect( effect2 );
Stage::GetCurrent().Add( actor2 );
Vector3 testVector3 = Vector3(45.0f, 55.0f, 65.0f);
float testFloat = 0.623f;
effect.SetLightDirection(testVector3);
effect.SetAmbientLightColorProperty(testVector3);
effect.SetDiffuseLightColorProperty(testVector3);
effect.SetStateProperty(testFloat);
effect.SetLightingMultiplierProperty(testFloat);
effect.SetHeightScaleProperty(testFloat);
effect2.SetFixedNormalProperty(testVector3);
application.SendNotification();
application.Render(0);
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetLightDirectionPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetAmbientLightColorPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetDiffuseLightColorPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetStatePropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetLightingMultiplierPropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetHeightScalePropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
Vector3 normalizedVector3(testVector3);
normalizedVector3.Normalize();
DALI_TEST_EQUALS( effect2.GetProperty( effect2.GetPropertyIndex( effect2.GetFixedNormalPropertyName() ) ).Get<Vector3>(), normalizedVector3, TEST_LOCATION );
END_TEST;
}
示例7: UtcDaliControlImplTouchEvent
int UtcDaliControlImplTouchEvent(void)
{
ToolkitTestApplication application;
{
DummyControl dummy = DummyControl::New( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
dummy.SetSize(100.0f, 100.0f);
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
DALI_TEST_EQUALS( dummyImpl.touchEventCalled, false, TEST_LOCATION );
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
application.ProcessEvent(touchEvent);
DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION );
Stage::GetCurrent().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
dummy.SetSize(100.0f, 100.0f);
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
application.ProcessEvent(touchEvent);
Stage::GetCurrent().Remove(dummy);
}
END_TEST;
}
示例8: utcDaliTextFieldTextChangedP
// Positive test for the text-changed signal.
int utcDaliTextFieldTextChangedP(void)
{
ToolkitTestApplication application;
tet_infoline(" utcDaliTextFieldTextChangedP");
TextField field = TextField::New();
DALI_TEST_CHECK( field );
Stage::GetCurrent().Add( field );
field.TextChangedSignal().Connect(&TestTextChangedCallback);
gTextChangedCallBackCalled = false;
field.SetProperty( TextField::Property::TEXT, "ABC" );
DALI_TEST_CHECK( gTextChangedCallBackCalled );
application.SendNotification();
field.SetKeyInputFocus();
gTextChangedCallBackCalled = false;
application.ProcessEvent( GenerateKey( "D", "D", 0, 0, 0, Integration::KeyEvent::Down ) );
DALI_TEST_CHECK( gTextChangedCallBackCalled );
END_TEST;
}
示例9: utcDaliTextFieldAtlasRenderP
// Positive Atlas Text Renderer test
int utcDaliTextFieldAtlasRenderP(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitTextFieldAtlasRenderP");
StyleManager styleManager = StyleManager::Get();
styleManager.RequestDefaultTheme();
TextField field = TextField::New();
DALI_TEST_CHECK( field );
field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
Stage::GetCurrent().Add( field );
try
{
// Render some text with the shared atlas backend
field.SetProperty( TextField::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
application.SendNotification();
application.Render();
}
catch( ... )
{
tet_result(TET_FAIL);
}
END_TEST;
}
示例10: UtcDaliConfirmationPopupTypeRegistryCreation
int UtcDaliConfirmationPopupTypeRegistryCreation(void)
{
ToolkitTestApplication application;
tet_infoline( " UtcDaliConfirmationPopupTypeRegistryCreation" );
TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ConfirmationPopup" );
DALI_TEST_CHECK( typeInfo )
BaseHandle baseHandle = typeInfo.CreateInstance();
DALI_TEST_CHECK( baseHandle )
Toolkit::Popup popup = Toolkit::Popup::DownCast( baseHandle );
popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
Stage::GetCurrent().Add( popup );
popup.SetDisplayState( Toolkit::Popup::SHOWN );
application.SendNotification();
application.Render();
// Check the popup is shown.
DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::SHOWN, TEST_LOCATION );
END_TEST;
}
示例11: UtcDaliPushButtonSetLabelText
static void UtcDaliPushButtonSetLabelText()
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliPushButtonSetLabelText");
const std::string STR( "Hola!" );
PushButton pushButton = PushButton::New();
application.SendNotification();
application.Render();
TextView textView;
pushButton.SetLabelText( STR );
textView = TextView::DownCast( pushButton.GetLabelText() );
DALI_TEST_CHECK( STR == textView.GetText() );
TextView text = TextView::New( STR );
pushButton.SetLabelText( text );
textView = TextView::DownCast( pushButton.GetLabelText() );
DALI_TEST_CHECK( STR == textView.GetText() );
}
示例12: UtcDaliSwirlDefaultValuesEffect
static void UtcDaliSwirlDefaultValuesEffect()
{
ToolkitTestApplication application;
Toolkit::SwirlEffect effect = Toolkit::SwirlEffect::New(true);
DALI_TEST_CHECK( effect );
BitmapImage image = CreateBitmapImage();
ImageActor actor = ImageActor::New( image );
actor.SetSize( 100.0f, 100.0f );
actor.SetShaderEffect( effect );
Stage::GetCurrent().Add( actor );
application.SendNotification();
application.Render();
// Gets converted to opengl viewport coordinates
DALI_TEST_CHECK(
application.GetGlAbstraction().CheckUniformValue(
effect.GetAnglePropertyName().c_str(),
0.0f ) );
DALI_TEST_CHECK(
application.GetGlAbstraction().CheckUniformValue(
effect.GetCenterPropertyName().c_str(),
Vector2(0.5f, 0.5f) ) );
DALI_TEST_CHECK(
application.GetGlAbstraction().CheckUniformValue(
effect.GetRadiusPropertyName().c_str(),
1.0f ) );
}
示例13: UtcDaliTextInputTextSelection
int UtcDaliTextInputTextSelection(void)
{
ToolkitTestApplication application;
tet_infoline("Testing Text Selection");
const std::string initialString = "initial text";
TextInput textInput = TextInput::New();
textInput.SetInitialText( initialString );
Stage::GetCurrent().Add(textInput);
application.SendNotification();
application.Render();
textInput.SetEditable( true );
tet_infoline("Testing IsTextSelected negative");
DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);
textInput.SelectText(1,7);
DALI_TEST_EQUALS( true, textInput.IsTextSelected(), TEST_LOCATION);
textInput.DeSelectText();
DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);
END_TEST;
}
示例14: UtcDaliTextInputSetAndGetFadeBoundary
int UtcDaliTextInputSetAndGetFadeBoundary(void)
{
tet_infoline("UtcDaliTextViewSetAndGetFadeBoundary: ");
ToolkitTestApplication application;
TextView::FadeBoundary fadeBoundary( PixelSize( 0 ), PixelSize( 20 ), PixelSize( 0 ), PixelSize( 10 ) );
TextInput textInput = TextInput::New();
textInput.SetInitialText( "Hello world!" );
Stage::GetCurrent().Add(textInput);
application.SendNotification();
application.Render();
textInput.SetFadeBoundary( fadeBoundary );
TextView::FadeBoundary fadeBoundary2 = textInput.GetFadeBoundary();
DALI_TEST_EQUALS( fadeBoundary.mLeft, fadeBoundary2.mLeft, TEST_LOCATION );
DALI_TEST_EQUALS( fadeBoundary.mRight, fadeBoundary2.mRight, TEST_LOCATION );
DALI_TEST_EQUALS( fadeBoundary.mTop, fadeBoundary2.mTop, TEST_LOCATION );
DALI_TEST_EQUALS( fadeBoundary.mBottom, fadeBoundary2.mBottom, TEST_LOCATION );
END_TEST;
}
示例15: UtcDaliTextInputExceedMaxCharacters
int UtcDaliTextInputExceedMaxCharacters(void)
{
ToolkitTestApplication application;
tet_infoline("Testing Max characters is obeyed when inputting key events ");
TextInput textInput = TextInput::New(); // create empty TextInput
Stage::GetCurrent().Add(textInput);
textInput.SetMaxCharacterLength(4);
textInput.SetInitialText("");
textInput.SetEditable(true);
application.SendNotification();
application.Render();
Integration::KeyEvent eventA("a", "a", 0, 0, 0, Integration::KeyEvent::Down );
Integration::KeyEvent eventB("b", "b", 0, 0, 0, Integration::KeyEvent::Down );
application.ProcessEvent(eventA);
application.ProcessEvent(eventB);
application.ProcessEvent(eventA);
application.ProcessEvent(eventB);
application.ProcessEvent(eventA);
application.ProcessEvent(eventB);
tet_printf( "Get text result : %s\n", textInput.GetText().c_str());
DALI_TEST_EQUALS("abab",textInput.GetText(), TEST_LOCATION); // Get text which should be only 4 characters
END_TEST;
}