X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Frendering-radial-progress%2Fradial-progress.cpp;h=614123da40f29785bf31abb69473aad18262959b;hb=1a473d5189ca7e7d55aca3a64a8a4ff2dc3b6c67;hp=2bef6b34ac119e1a0ca2c982c72f0971f0ee0ac5;hpb=cc86309efaef5f77c85ece1199f95e08534e4a32;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/rendering-radial-progress/radial-progress.cpp b/examples/rendering-radial-progress/radial-progress.cpp index 2bef6b3..614123d 100644 --- a/examples/rendering-radial-progress/radial-progress.cpp +++ b/examples/rendering-radial-progress/radial-progress.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -124,19 +124,19 @@ public: // The Init signal is received once (only) during the Application lifetime void Create( Application& application ) { - Stage stage = Stage::GetCurrent(); - stage.SetBackgroundColor( Color::BLACK ); + Window window = application.GetWindow(); + window.SetBackgroundColor( Color::BLACK ); - // Connect to the stage's key signal to allow Back and Escape to exit. - stage.KeyEventSignal().Connect( this, &RadialProgressController::OnKeyEvent ); + // Connect to the window's key signal to allow Back and Escape to exit. + window.KeyEventSignal().Connect( this, &RadialProgressController::OnKeyEvent ); // 1. Create actor to show the effect mActor = Actor::New(); mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - mActor.SetSize( Vector2( TEXTURE_WIDTH, TEXTURE_HEIGHT ) ); + mActor.SetProperty( Actor::Property::SIZE, Vector2( TEXTURE_WIDTH, TEXTURE_HEIGHT ) ); mActor.RegisterProperty("uProgress", float(1.0f) ); - stage.Add( mActor ); + window.Add( mActor ); // 1. Create stencil renderer i.e. a triangle fan in the shape of a circle Renderer stencilRenderer = CreatePolygon( NUMBER_OF_SIDES ); @@ -152,10 +152,10 @@ public: animation.Play(); // 6. Exit the application when touched - stage.GetRootLayer().TouchSignal().Connect( this, &RadialProgressController::OnTouch ); + window.GetRootLayer().TouchedSignal().Connect( this, &RadialProgressController::OnTouch ); } - bool OnTouch( Actor actor, const TouchData& touch ) + bool OnTouch( Actor actor, const TouchEvent& touch ) { // quit the application mApplication.Quit(); @@ -188,7 +188,7 @@ public: vertexFormat[ "aPosition" ] = Property::VECTOR3; // describe vertex format ( only 2-dimensional positions ) - PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat ); + VertexBuffer vertexBuffer = VertexBuffer::New( vertexFormat ); vertexBuffer.SetData( vertices.data(), vertices.size() ); // create geometry @@ -238,7 +238,7 @@ public: Property::Map vertexFormat; vertexFormat["aPosition"] = Property::VECTOR2; - PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat ); + VertexBuffer vertexBuffer = VertexBuffer::New( vertexFormat ); const float P( 0.5f ); const Vector2 vertices[] = { @@ -294,7 +294,7 @@ public: */ void OnKeyEvent( const KeyEvent& event ) { - if( event.state == KeyEvent::Down ) + if( event.GetState() == KeyEvent::DOWN ) { if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) {