/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
//
//
//------------------------------------------------------------------------------
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
{
Application dali_app = Application::New(&argc, &argv, DEMO_THEME_PATH);
<ui-application appid="text-fonts.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-fonts.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Text Fonts</label>
</ui-application>
+ <ui-application appid="text-memory-profiling.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-memory-profiling.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+ <label>Text Memory Profiling</label>
+ </ui-application>
<ui-application appid="text-scrolling.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-scrolling.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Text Scrolling</label>
</ui-application>
- <ui-application appid="logging.example" exec="/usr/apps/com.samsung.dali-demo/bin/logging.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
- <label>Logging</label>
- </ui-application>
<ui-application appid="animated-shapes.example" exec="/usr/apps/com.samsung.dali-demo/bin/animated-shapes.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Animated shapes</label>
</ui-application>
demo.AddExample(Example("image-view-alpha-blending.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING));
demo.AddExample(Example("image-view-pixel-area.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA));
demo.AddExample(Example("image-view-svg.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG));
+ demo.AddExample(Example("image-view-url.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL));
demo.AddExample(Example("line-mesh.example", DALI_DEMO_STR_TITLE_LINE_MESH));
- demo.AddExample(Example("logging.example", DALI_DEMO_STR_TITLE_LOGGING));
demo.AddExample(Example("magnifier.example", DALI_DEMO_STR_TITLE_MAGNIFIER));
demo.AddExample(Example("mesh-morph.example", DALI_DEMO_STR_TITLE_MESH_MORPH));
- demo.AddExample(Example("mesh-sorting.example", DALI_DEMO_STR_TITLE_MESH_SORTING));
demo.AddExample(Example("motion-stretch.example", DALI_DEMO_STR_TITLE_MOTION_STRETCH));
demo.AddExample(Example("native-image-source.example", DALI_DEMO_STR_TITLE_NATIVE_IMAGE_SOURCE));
demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP));
demo.AddExample(Example("text-label.example", DALI_DEMO_STR_TITLE_TEXT_LABEL));
demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE));
demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT));
+ demo.AddExample(Example("text-memory-profiling.example", DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING));
demo.AddExample(Example("text-overlap.example", DALI_DEMO_STR_TITLE_TEXT_OVERLAP));
demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING));
demo.AddExample(Example("remote-image-loading.example", DALI_DEMO_STR_TITLE_REMOTE_IMAGE));
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <cstring>
using namespace Dali;
Property::Map map;
map.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::Type::IMAGE );
map.Add( Toolkit::ImageVisual::Property::URL, image );
- map.Add( Toolkit::DevelImageVisual::Property::ALPHA_MASK_URL, mask );
+ map.Add( Toolkit::ImageVisual::Property::ALPHA_MASK_URL, mask );
if( mImageCombinationIndex%2 == 0 )
{
- map.Add( Toolkit::DevelImageVisual::Property::MASK_CONTENT_SCALE, 1.f );
- map.Add( Toolkit::DevelImageVisual::Property::CROP_TO_MASK, false );
+ map.Add( Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE, 1.f );
+ map.Add( Toolkit::ImageVisual::Property::CROP_TO_MASK, false );
}
else
{
- map.Add( Toolkit::DevelImageVisual::Property::MASK_CONTENT_SCALE, 1.6f );
- map.Add( Toolkit::DevelImageVisual::Property::CROP_TO_MASK, true );
+ map.Add( Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE, 1.6f );
+ map.Add( Toolkit::ImageVisual::Property::CROP_TO_MASK, true );
}
mImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
int mImageCombinationIndex;
};
-void RunTest( Application& application )
-{
- ImageViewAlphaBlendApp test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ImageViewAlphaBlendApp test( application );
+ application.MainLoop();
return 0;
}
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include "shared/utility.h"
using namespace Dali;
if( type == IMAGE_ARRAY )
{
map
- .Add( Toolkit::DevelImageVisual::Property::BATCH_SIZE, 4 )
- .Add( Toolkit::DevelImageVisual::Property::CACHE_SIZE, 10 )
- .Add( Toolkit::DevelImageVisual::Property::FRAME_DELAY, 150 );
+ .Add( Toolkit::ImageVisual::Property::BATCH_SIZE, 4 )
+ .Add( Toolkit::ImageVisual::Property::CACHE_SIZE, 10 )
+ .Add( Toolkit::ImageVisual::Property::FRAME_DELAY, 150 );
}
}
ImageType mImageType;
};
-// Entry point for Linux & Tizen applications
//
int DALI_EXPORT_API main( int argc, char **argv )
{
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
background.SetParentOrigin( Dali::ParentOrigin::CENTER );
background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
Dali::Property::Map map;
- map.Insert( Visual::Property::TYPE, Visual::GRADIENT );
+ map.Insert( Toolkit::Visual::Property::TYPE, Visual::GRADIENT );
Property::Array stopOffsets;
stopOffsets.PushBack( 0.0f );
stopOffsets.PushBack( 1.0f );
};
-void RunTest( Application& application )
+int DALI_EXPORT_API main( int argc, char **argv )
{
+ Application application = Application::New( &argc, &argv );
AnimatedShapesExample test( application );
application.MainLoop();
-}
-
-int main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv );
- RunTest( application );
-
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
Animation mHide;
};
-void RunTest( Application& application )
-{
- Benchmark test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
}
}
- RunTest( application );
+ Benchmark test( application );
+ application.MainLoop();
return 0;
}
int mBrickCount; ///< Total bricks on screen.
};
-void RunTest(Application& app)
-{
- ExampleController test(app);
-
- app.MainLoop();
-}
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ ExampleController test(app);
+ app.MainLoop();
return 0;
}
/*****************************************************************************/
-static void
-RunTest(Application& app)
-{
- BubbleEffectExample theApp(app);
- app.MainLoop();
-}
-
-/*****************************************************************************/
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ BubbleEffectExample theApp(app);
+ app.MainLoop();
return 0;
}
Toolkit::ImageView mImage;
};
-void RunTest( Application& application )
-{
- ButtonsController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ ButtonsController test( application );
+ application.MainLoop();
return 0;
}
Stage stage = Stage::GetCurrent();
stage.SetBackgroundColor( Color::WHITE );
+ // Connect to the stage's key signal to allow Back and Escape to exit.
+ stage.KeyEventSignal().Connect( this, &ClippingDrawOrderVerification::OnKeyEvent );
+
// Create the title label.
TextLabel title = TextLabel::New( "Clipping draw order verification" );
title.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
return true;
}
+ /**
+ * @brief Called when any key event is received
+ *
+ * Will use this to quit the application if Back or the Escape key is received
+ * @param[in] event The key event information
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
private:
Application& mApplication;
};
-void RunVerification( Application& application )
-{
- ClippingDrawOrderVerification verification( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications.
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunVerification( application );
-
+ ClippingDrawOrderVerification verification( application );
+ application.MainLoop();
return 0;
}
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/actors/actor-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
// INTERNAL INCLUDES
#include "clipping-item-factory.h"
border.SetParentOrigin( ParentOrigin::CENTER );
border.SetAnchorPoint( AnchorPoint::CENTER );
border.SetProperty( Control::Property::BACKGROUND,
- Property::Map().Add( Visual::Property::TYPE, Visual::BORDER )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::BORDER )
.Add( BorderVisual::Property::COLOR, Color::WHITE )
.Add( BorderVisual::Property::SIZE, 2.0f )
.Add( BorderVisual::Property::ANTI_ALIASING, true ) );
borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) );
borderActor.SetColorMode( USE_PARENT_COLOR );
borderActor.SetProperty( ImageView::Property::IMAGE,
- Property::Map().Add( Visual::Property::TYPE, Visual::BORDER )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::BORDER )
.Add( BorderVisual::Property::COLOR, Color::WHITE )
.Add( BorderVisual::Property::SIZE, ITEM_BORDER_SIZE )
.Add( BorderVisual::Property::ANTI_ALIASING, true ) );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/dali.h>
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
Application& mApplication;
};
-void RunTest( Application& application )
-{
- CompressedTextureFormatsController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ CompressedTextureFormatsController test( application );
+ application.MainLoop();
return 0;
}
// Create a control which will be used for the background and to clip the contents
mContactCard = Control::New();
mContactCard.SetProperty( Control::Property::BACKGROUND,
- Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
.Add( ColorVisual::Property::MIX_COLOR, Color::WHITE ) );
mContactCard.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
mContactCard.SetParentOrigin( ParentOrigin::TOP_LEFT );
mHeader = Control::New();
mHeader.SetSize( mContactCardLayoutInfo.headerSize );
mHeader.SetProperty( Control::Property::BACKGROUND,
- Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
.Add( ColorVisual::Property::MIX_COLOR, HEADER_COLOR ) );
mHeader.SetParentOrigin( ParentOrigin::TOP_LEFT );
mHeader.SetAnchorPoint( AnchorPoint::TOP_LEFT );
}
}
-// Entry point for Linux & Tizen applications
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
return false; //return false to stop the timer
}
-// Entry point for Linux & Tizen applications
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
/*****************************************************************************/
-static void RunTest( Application& application )
-{
- EffectsViewApp test( application );
-
- application.MainLoop();
-}
-
-/*****************************************************************************/
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application application = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(application);
-
+ EffectsViewApp test( application );
+ application.MainLoop();
return 0;
}
Toolkit::PushButton mAlignContentButton;
};
-void RunTest(Application& app)
-{
- FlexContainerExample test(app);
-
- app.MainLoop();
-}
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ FlexContainerExample test(app);
+ app.MainLoop();
return 0;
}
Layer mContentLayer; ///< Content layer.
};
-// Entry point for Linux & Tizen applications
//
int DALI_EXPORT_API main( int argc, char **argv )
{
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
FppGameTutorialController mTutorialController;
};
-void RunTest( Application& application )
-{
- GameController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ GameController test( application );
+ application.MainLoop();
return 0;
}
mLeftLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mLeftLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
- Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
.Add( ColorVisual::Property::MIX_COLOR, Vector4( 0.0, 0.0, 0.7, 0.2 ) ) );
mLeftLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
mLeftLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mRightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mRightLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
- Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
.Add( ColorVisual::Property::MIX_COLOR, Vector4( 0.5, 0.0, 0.0, 0.2 ) ) );
mRightLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
mRightLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
// ---- Gradient for background
- mGradientMap.Insert( Visual::Property::TYPE, Visual::GRADIENT );
+ mGradientMap.Insert( Toolkit::Visual::Property::TYPE, Visual::GRADIENT );
Property::Array stopOffsets;
stopOffsets.PushBack( 0.0f );
unsigned mIndex;
};
-void RunTest( Application& application )
-{
- GradientController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ GradientController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Application& mApplication;
};
-void RunTest( Application& application )
-{
- HelloWorldController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ HelloWorldController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <iostream>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
using namespace Dali;
using Dali::Toolkit::TextLabel;
else
{
Property::Map map;
- map.Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT ).
+ map.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT ).
Add( Toolkit::TextVisual::Property::TEXT, DEMO_APPS_NAMES[currentIconIndex] ).
Add( Toolkit::TextVisual::Property::TEXT_COLOR, Color::WHITE ).
Add( Toolkit::TextVisual::Property::POINT_SIZE, ( ( static_cast<float>( ROW_HEIGHT * LABEL_AREA ) * 72.0f ) / dpi.y ) * 0.25f ).
int mCurrentPage;
};
-void RunTest( Application& application, const HomescreenBenchmark::Config& config, bool printHelpAndExit )
-{
- HomescreenBenchmark test( application, config );
-
- if( printHelpAndExit )
- {
- PrintHelp( "c<num>", " Number of columns" );
- PrintHelp( "r<num>", " Number of rows" );
- PrintHelp( "p<num>", " Number of pages ( must be greater than 1 )" );
- PrintHelp( "-disable-tableview", " Disables the use of TableView for layouting" );
- PrintHelp( "-disable-icon-labels", " Disables labels for each icon" );
- PrintHelp( "-use-checkbox", " Uses checkboxes for icons" );
- PrintHelp( "-use-text-label", " Uses TextLabel instead of a TextVisual" );
- return;
- }
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications.
int DALI_EXPORT_API main( int argc, char **argv )
{
// Default settings.
}
Application application = Application::New( &argc, &argv );
+ HomescreenBenchmark test( application, config );
- RunTest( application, config, printHelpAndExit );
+ if( printHelpAndExit )
+ {
+ PrintHelp( "c<num>", " Number of columns" );
+ PrintHelp( "r<num>", " Number of rows" );
+ PrintHelp( "p<num>", " Number of pages ( must be greater than 1 )" );
+ PrintHelp( "-disable-tableview", " Disables the use of TableView for layouting" );
+ PrintHelp( "-disable-icon-labels", " Disables labels for each icon" );
+ PrintHelp( "-use-checkbox", " Uses checkboxes for icons" );
+ PrintHelp( "-use-text-label", " Uses TextLabel instead of a TextVisual" );
+ return 0;
+ }
+
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
-#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
#include "shared/view.h"
#include <iostream>
};
-void RunTest( Application& application )
-{
- ImageScalingAndFilteringController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ ImageScalingAndFilteringController test( application );
+ application.MainLoop();
return 0;
}
image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) );
image.SetSize( imageSize );
image.TouchSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
- Toolkit::DevelControl::ResourceReadySignal( image).Connect( this, &ImageScalingIrregularGridController::ResourceReadySignal);
+ image.ResourceReadySignal().Connect( this, &ImageScalingIrregularGridController::ResourceReadySignal );
mFittingModes[image.GetId()] = fittingMode;
mResourceUrls[image.GetId()] = imageSource.configuration.path;
mSizes[image.GetId()] = imageSize;
unsigned int mImagesLoaded; ///< How many images have been loaded
};
-void RunTest( Application& application )
-{
- ImageScalingIrregularGridController test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ ImageScalingIrregularGridController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
unsigned int mIndex;
};
-void RunTest( Application& application )
-{
- ImageViewAlphaBlendApp test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ImageViewAlphaBlendApp test( application );
+ application.MainLoop();
return 0;
}
unsigned int mIndex;
};
-void RunTest( Application& application )
-{
- ImageViewPixelAreaApp test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ImageViewPixelAreaApp test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mPinchGestureDetector.Attach( mStageBackground);
mPinchGestureDetector.DetectedSignal().Connect(this, &ImageSvgController::OnPinch);
- DevelActor::RaiseToTop(changeButton);
- DevelActor::RaiseToTop(resetButton);
+ changeButton.RaiseToTop();
+ resetButton.RaiseToTop();
}
// Callback of push button, for changing image set
unsigned int mIndex;
};
-void RunTest( Application& application )
-{
- ImageSvgController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ImageSvgController test( application );
+ application.MainLoop();
return 0;
}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+
+#include "shared/view.h"
+
+using namespace Dali;
+
+namespace
+{
+const char* BIG_TEST_IMAGE( DEMO_IMAGE_DIR "book-landscape-cover.jpg" );
+
+const char * const APPLICATION_TITLE( "Image View URL" );
+const char * const TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
+const char * const BUTTON_ICON( DEMO_IMAGE_DIR "icon-change.png" );
+const char * const BUTTON_ICON_SELECTED( DEMO_IMAGE_DIR "icon-change-selected.png" );
+
+const char* FILTER_FRAGMENT_SOURCE =
+{
+ "precision highp float;\n"
+ "varying mediump vec2 vTexCoord;\n"
+ "uniform sampler2D sTexture;\n"
+ "uniform mediump float uDelta;\n"
+ "void main()\n"
+ "{\n"
+ " vec4 color = vec4(0.0);\n"
+ " vec2 texCoord = vTexCoord * 2. - 1.;\n"
+ " mat2 rotation = mat2(cos(uDelta), -sin(uDelta), sin(uDelta), cos(uDelta));"
+ " texCoord = (rotation * texCoord) * .5 + .5;\n"
+ " color += texture2D( sTexture, texCoord );\n"
+ " gl_FragColor = color;\n"
+ "}\n"
+};
+
+const char* DELTA_UNIFORM_NAME = "uDelta";
+
+const Vector2 TARGET_SIZE(800.f, 800.f);
+}
+
+class ImageViewUrlApp : public ConnectionTracker
+{
+public:
+ ImageViewUrlApp( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &ImageViewUrlApp::Create );
+ }
+
+ ~ImageViewUrlApp() = default;
+
+private:
+ // The Init signal is received once (only) during the Application lifetime
+ void Create( Application& application )
+ {
+ // Get a handle to the stage
+ Stage stage = Stage::GetCurrent();
+ stage.KeyEventSignal().Connect(this, &ImageViewUrlApp::OnKeyEvent);
+
+ Toolkit::ToolBar toolBar;
+ Toolkit::Control background;
+ // Creates a default view with a default tool bar.
+ mContent = DemoHelper::CreateView( application,
+ background,
+ toolBar,
+ "",
+ TOOLBAR_IMAGE,
+ APPLICATION_TITLE );
+
+ // Add a button to switch the scene. (right of toolbar)
+ Toolkit::PushButton switchButton = Toolkit::PushButton::New();
+ switchButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_ICON );
+ switchButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BUTTON_ICON_SELECTED );
+ switchButton.ClickedSignal().Connect( this, &ImageViewUrlApp::OnButtonClicked );
+ toolBar.AddControl( switchButton,
+ DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
+ Toolkit::Alignment::HorizontalRight,
+ DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
+
+ CreateRenderTask( );
+ CreateScene( );
+ }
+
+ void CreateRenderTask()
+ {
+ auto rootActor = Stage::GetCurrent().GetRootLayer();
+
+ auto cameraActor = CameraActor::New(TARGET_SIZE);
+ cameraActor.SetParentOrigin(ParentOrigin::CENTER);
+ cameraActor.SetInvertYAxis(true);
+ rootActor.Add(cameraActor);
+
+ {
+ // create actor to render input with applied shader
+ mActorForInput = Toolkit::ImageView::New(BIG_TEST_IMAGE);
+ mActorForInput.SetParentOrigin(ParentOrigin::CENTER);
+ mActorForInput.SetSize(TARGET_SIZE);
+ Property::Map customShader;
+ customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = FILTER_FRAGMENT_SOURCE;
+ Property::Map visualMap;
+ visualMap.Insert(Toolkit::Visual::Property::SHADER, customShader);
+ mActorForInput.SetProperty(Toolkit::ImageView::Property::IMAGE, visualMap);
+
+ mDeltaPropertyIndex = mActorForInput.RegisterProperty(DELTA_UNIFORM_NAME, 0.f);
+
+ rootActor.Add(mActorForInput);
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+
+ // perform a horizontal blur targeting the internal buffer
+ auto renderTask = taskList.CreateTask();
+ renderTask.SetRefreshRate(RenderTask::REFRESH_ALWAYS);
+ renderTask.SetSourceActor(mActorForInput);
+ renderTask.SetExclusive(true);
+ renderTask.SetInputEnabled(false);
+ renderTask.SetClearColor(Vector4(1.,0.,0.,1.));
+ renderTask.SetClearEnabled(true);
+ renderTask.SetCameraActor(cameraActor);
+
+ mOutputTexture = Texture::New(TextureType::TEXTURE_2D,
+ Pixel::RGB888,
+ unsigned(TARGET_SIZE.width),
+ unsigned(TARGET_SIZE.height));
+ auto framebuffer = FrameBuffer::New(TARGET_SIZE.width, TARGET_SIZE.height, Pixel::RGB888);
+ framebuffer.AttachColorTexture(mOutputTexture);
+
+ renderTask.SetFrameBuffer(framebuffer);
+ }
+ {
+ // animate the shader uniform
+ mAnimation = Animation::New(10.f);
+
+ mActorForInput.SetProperty( mDeltaPropertyIndex, 0.f );
+ mAnimation.AnimateTo( Property( mActorForInput, mDeltaPropertyIndex ), Math::PI * 2.f );
+ mAnimation.SetLooping(true);
+ mAnimation.Play();
+ }
+ }
+
+ void CreateScene( )
+ {
+ auto url = Dali::Toolkit::TextureManager::AddTexture(mOutputTexture);
+ mImageView = Toolkit::ImageView::New(url);
+
+ mImageView.SetParentOrigin(ParentOrigin::CENTER);
+ mImageView.SetAnchorPoint(AnchorPoint::CENTER);
+ mContent.Add(mImageView);
+ }
+
+ bool OnButtonClicked(Toolkit::Button button)
+ {
+ if(mAnimation.GetState() == Animation::State::PLAYING)
+ {
+ mAnimation.Pause();
+ }
+ else
+ {
+ mAnimation.Play();
+ }
+ return true;
+ }
+
+ void OnKeyEvent(const KeyEvent& event)
+ {
+ if(event.state == KeyEvent::Down)
+ {
+ if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+private:
+ Application& mApplication;
+ Layer mContent;
+ Toolkit::ImageView mImageView;
+ Animation mAnimation;
+ Actor mActorForInput;
+ Property::Index mDeltaPropertyIndex;
+ Texture mOutputTexture;
+};
+
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv );
+ ImageViewUrlApp test( application );
+ application.MainLoop();
+ return 0;
+}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "shared/view.h"
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
using namespace Dali;
};
-void RunTest( Application& application )
-{
- ImageViewController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ ImageViewController test( application );
+ application.MainLoop();
return 0;
}
borderActor.SetColorMode( USE_PARENT_COLOR );
Property::Map borderProperty;
- borderProperty.Insert( Visual::Property::TYPE, Visual::BORDER );
+ borderProperty.Insert( Toolkit::Visual::Property::TYPE, Visual::BORDER );
borderProperty.Insert( BorderVisual::Property::COLOR, Color::WHITE );
borderProperty.Insert( BorderVisual::Property::SIZE, ITEM_BORDER_SIZE );
borderProperty.Insert( BorderVisual::Property::ANTI_ALIASING, true );
checkbox.SetZ( 0.1f );
Property::Map solidColorProperty;
- solidColorProperty.Insert( Visual::Property::TYPE, Visual::COLOR );
+ solidColorProperty.Insert( Toolkit::Visual::Property::TYPE, Visual::COLOR );
solidColorProperty.Insert( ColorVisual::Property::MIX_COLOR, Vector4(0.f, 0.f, 0.f, 0.6f) );
checkbox.SetProperty( ImageView::Property::IMAGE, solidColorProperty );
LongPressGestureDetector mLongPressDetector;
};
-void RunTest(Application& app)
-{
- ItemViewExample test(app);
-
- app.MainLoop();
-}
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ ItemViewExample test(app);
+ app.MainLoop();
return 0;
}
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
// INTERNAL INCLUDES
#include "shared/view.h"
radio.SetProperty( Toolkit::Button::Property::LABEL,
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT )
+ .Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
.Add( Toolkit::TextVisual::Property::TEXT, labels[i] )
.Add( Toolkit::TextVisual::Property::TEXT_COLOR, Vector4( 0.8f, 0.8f, 0.8f, 1.0f ) )
);
int mMaxIndexCount;
};
-void RunTest( Application& application )
-{
- ExampleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ExampleController test( application );
+ application.MainLoop();
return 0;
}
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "shared/view.h"
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/adaptor-framework/performance-logger.h>
-#include <sstream>
-
-using namespace Dali;
-
-// Define this so that it is interchangeable
-// "DP" stands for Device independent Pixels
-#define DP(x) x
-
-//enum ButtonType
-//{
-// PUSH_BUTTON,
-// TOGGLE_BUTTON
-//};
-//
-//struct ButtonItem
-//{
-// ButtonType type;
-// const char* name;
-// const char* text;
-// const char* altText;
-//};
-
-namespace
-{
-
-const char* const BACKGROUND_IMAGE = DEMO_IMAGE_DIR "background-gradient.jpg";
-const char* const TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png";
-
-const char* const TOOLBAR_TITLE = "Logging";
-//const int TOOLBAR_HEIGHT = 62;
-
-const int MARGIN_SIZE = 10;
-const int TOP_MARGIN = 85;
-
-const int LOGGER_GROUP_HEIGHT = 84;
-const int LOGGER_RADIO_GROUP_HEIGHT = 200;
-
-const int LOGGER_RADIO_SPACING = 48;
-
-const int CONSOLE_HEIGHT = 84;
-
-const int BUTTON_WIDTH = 200;
-const int BUTTON_HEIGHT = LOGGER_GROUP_HEIGHT - MARGIN_SIZE * 2;
-
-const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f );
-
-// Button IDs
-const char* const LOGGER_1_RADIO_ID = "LOGGER_1_RADIO";
-const char* const LOGGER_2_RADIO_ID = "LOGGER_2_RADIO";
-const char* const LOGGER_3_RADIO_ID = "LOGGER_3_RADIO";
-
-const char* const FREQUENCY_1_RADIO_ID = "FREQUENCY_1_RADIO";
-const char* const FREQUENCY_2_RADIO_ID = "FREQUENCY_2_RADIO";
-const char* const FREQUENCY_3_RADIO_ID = "FREQUENCY_3_RADIO";
-
-const char* const CREATE_BUTTON_ID = "CREATE_BUTTON";
-const char* const DELETE_BUTTON_ID = "DELETE_BUTTON";
-const char* const START_BUTTON_ID = "START_BUTTON";
-const char* const STOP_BUTTON_ID = "STOP_BUTTON";
-const char* const HIGH_FREQ_BUTTON_ID = "INC_FREQ_BUTTON";
-const char* const LOW_FREQ_BUTTON_ID = "DEC_FREQ_BUTTON";
-const char* const ENABLE_BUTTON_ID = "ENABLE_BUTTON";
-const char* const DISABLE_BUTTON_ID = "DISABLE_BUTTON";
-const char* const VSYNC_BUTTON_ID = "VSYNC_BUTTON";
-
-const char* const CREATE_BUTTON_TEXT = "Create";
-const char* const DELETE_BUTTON_TEXT = "Delete";
-const char* const START_BUTTON_TEXT = "Start";
-const char* const STOP_BUTTON_TEXT = "Stop";
-const char* const ENABLE_BUTTON_TEXT = "Enable";
-const char* const DISABLE_BUTTON_TEXT = "Disable";
-const char* const VSYNC_BUTTON_TEXT = "Vsync";
-
-const char* const FREQUENCY_1_RADIO_TEXT = "1";
-const char* const FREQUENCY_2_RADIO_TEXT = "2";
-const char* const FREQUENCY_3_RADIO_TEXT = "10";
-
-const char* const LOGGER_TEXT = "Logger:";
-const char* const FREQUENCY_TEXT = "Frequency (sec):";
-
-const unsigned int NUM_LOGGERS = 3;
-
-const unsigned int HIGH_FREQUENCY = 1; // Seconds
-const unsigned int MEDIUM_FREQUENCY = 2; // Seconds
-const unsigned int LOW_FREQUENCY = 10; // Seconds
-const unsigned int NUM_FREQUENCIES = 3;
-
-} // namespace
-
-/**
- * This example is a test harness for performance loggers.
- *
- * Press one of the create buttons to create a logger. This will output on vsync at the default frequency (2 seconds).
- * In case nothing appears in the log, force a vsync by touching anywhere on the screen. Loggers can be deleted
- * with the delete buttons. They can be enabled or disabled in which case logging will appear or disappear in the console
- * respectively. To record information in a logger press the start and then stop button in succession quickly in between
- * the time period when it would print to the console. This is necessary as the logger is cleared of information when
- * it prints. The output will contain the smallest and largest times between start and stop recorded (minimum and maximum),
- * the total time recorded by the logger as well as the average and standard deviation of all the times recorded. The
- * frequency of log output can be set to high frequency (every 1 second) or low frequency (every 10 seconds).
- */
-class LoggingController: public ConnectionTracker
-{
- public:
-
- LoggingController( Application& application )
- : mApplication( application ),
- mView(),
- mToolBar(),
- mContentLayer(),
- mAnimation(),
- mPerformanceLoggerNames(),
- mPerformanceLoggers(),
- mCurrentLogger( 0 ),
- mLoggerStates(),
- mLogRadioButtons(),
- mFrequencyRadioButtons()
- {
- // Connect to the Application's Init signal
- mApplication.InitSignal().Connect( this, &LoggingController::Create );
- }
-
- ~LoggingController()
- {
- // Nothing to do here
- }
-
- void Create( Application& application )
- {
- // The Init signal is received once (only) during the Application lifetime
-
- mCurrentLogger = 0;
- mPerformanceLoggers.reserve( NUM_LOGGERS );
- mPerformanceLoggers.resize( NUM_LOGGERS );
-
- mPerformanceLoggerNames.reserve( NUM_LOGGERS );
- mPerformanceLoggerNames.resize( NUM_LOGGERS );
-
- mLoggerStates.reserve( NUM_LOGGERS );
- mLoggerStates.resize( NUM_LOGGERS );
-
- mLogRadioButtons.reserve( NUM_LOGGERS );
- mLogRadioButtons.resize( NUM_LOGGERS );
-
- mFrequencyRadioButtons.reserve( NUM_FREQUENCIES );
- mFrequencyRadioButtons.resize( NUM_FREQUENCIES );
-
- // Respond to key events
- Stage::GetCurrent().KeyEventSignal().Connect(this, &LoggingController::OnKeyEvent);
-
- // Creates a default view with a default tool bar.
- // The view is added to the stage.
- mContentLayer = DemoHelper::CreateView( application,
- mView,
- mToolBar,
- BACKGROUND_IMAGE,
- TOOLBAR_IMAGE,
- TOOLBAR_TITLE );
-
- Toolkit::TableView contentTable = Toolkit::TableView::New( 6, 1 );
- contentTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- contentTable.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
- contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-
- for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
- {
- contentTable.SetFitHeight( i );
- }
-
- contentTable.SetPosition( 0.0f, TOP_MARGIN );
-
- mContentLayer.Add( contentTable );
-
-
- // Logger selector radio group
- Toolkit::TableView radioGroupBackground = Toolkit::TableView::New( 2, 1 );
- radioGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- radioGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- radioGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
- radioGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-
- contentTable.Add( radioGroupBackground );
-
- // Label
- {
- Toolkit::TextLabel label = Toolkit::TextLabel::New( LOGGER_TEXT );
- label.SetParentOrigin( ParentOrigin::TOP_LEFT );
- label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
- label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-
- radioGroupBackground.Add( label );
- radioGroupBackground.SetFitHeight( 0 );
- }
-
- // Radio group
- Toolkit::TableView radioButtonsGroup = Toolkit::TableView::New( 3, 1 );
- radioButtonsGroup.SetCellPadding( Size( 0.0f, MARGIN_SIZE * 0.5f ) );
- radioButtonsGroup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- for( unsigned int i = 0; i < radioButtonsGroup.GetRows(); ++i )
- {
- radioButtonsGroup.SetFitHeight( i );
- }
- radioButtonsGroup.SetFitWidth( 0 );
-
- radioGroupBackground.Add( radioButtonsGroup );
- radioGroupBackground.SetFitHeight( 1 );
-
- int radioX = 0;
- int radioY = 0;
-
- // Radio 1
- {
- Toolkit::RadioButton radioButton = Toolkit::RadioButton::New();
- radioButton.SetName( LOGGER_1_RADIO_ID );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButton.SetPosition( DP(radioX), DP(radioY) );
- radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
-
- radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );
-
- radioButtonsGroup.Add( radioButton );
- mLogRadioButtons[0] = radioButton;
- }
-
- // Radio 2
- {
- radioY += LOGGER_RADIO_SPACING;
-
- Toolkit::RadioButton radioButton = Toolkit::RadioButton::New();
- radioButton.SetName( LOGGER_2_RADIO_ID );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButton.SetPosition( DP(radioX), DP(radioY) );
-
- radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );
-
- radioButtonsGroup.Add( radioButton );
- mLogRadioButtons[1] = radioButton;
- }
-
- // Radio 3
- {
- radioY += LOGGER_RADIO_SPACING;
-
- Toolkit::RadioButton radioButton = Toolkit::RadioButton::New();
- radioButton.SetName( LOGGER_3_RADIO_ID );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButton.SetPosition( DP(radioX), DP(radioY) );
-
- radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );
-
- radioButtonsGroup.Add( radioButton );
- mLogRadioButtons[2] = radioButton;
- }
-
- // Create/delete/disable group
- Toolkit::TableView createGroupBackground = Toolkit::TableView::New( 1, 2 );
- createGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- createGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- createGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
- createGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
- createGroupBackground.SetFitHeight( 0 );
-
- contentTable.Add( createGroupBackground );
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( CREATE_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, CREATE_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- createGroupBackground.Add( button );
- }
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( DELETE_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, DELETE_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- createGroupBackground.Add( button );
- }
-
- // Start/stop group
-
- Toolkit::TableView timingGroupBackground = Toolkit::TableView::New( 1, 2 );
- timingGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- timingGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- timingGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
- timingGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
- timingGroupBackground.SetFitHeight( 0 );
-
- contentTable.Add( timingGroupBackground );
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( START_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, START_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- timingGroupBackground.Add( button );
- }
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( STOP_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, STOP_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- timingGroupBackground.Add( button );
- }
-
- // Enable/disable group
- Toolkit::TableView enableGroupBackground = Toolkit::TableView::New( 1, 2 );
- enableGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- enableGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- enableGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
- enableGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
- enableGroupBackground.SetFitHeight( 0 );
-
- contentTable.Add( enableGroupBackground );
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( ENABLE_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, ENABLE_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- enableGroupBackground.Add( button );
- }
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( DISABLE_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, DISABLE_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- enableGroupBackground.Add( button );
- }
-
- // Logger selector radio group
- Toolkit::TableView frequencyRadioGroupBackground = Toolkit::TableView::New( 2, 1 );
- frequencyRadioGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- frequencyRadioGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- frequencyRadioGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
- frequencyRadioGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
- frequencyRadioGroupBackground.SetFitHeight( 0 );
- frequencyRadioGroupBackground.SetFitHeight( 1 );
-
- contentTable.Add( frequencyRadioGroupBackground );
-
- // Label
- {
- Toolkit::TextLabel label = Toolkit::TextLabel::New( FREQUENCY_TEXT );
-
- frequencyRadioGroupBackground.Add( label );
- }
-
- // Radio group
- Toolkit::TableView frequencyRadioButtonsGroup = Toolkit::TableView::New( 1, 3 );
- frequencyRadioButtonsGroup.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- frequencyRadioButtonsGroup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- frequencyRadioButtonsGroup.SetFitHeight( 0 );
- frequencyRadioButtonsGroup.SetPadding( Padding( 0.0f, 0.0f, MARGIN_SIZE, 0.0f ) );
-
- frequencyRadioGroupBackground.Add( frequencyRadioButtonsGroup );
-
- // Radio 1
- {
- Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_1_RADIO_TEXT );
- radioButton.SetName( FREQUENCY_1_RADIO_ID );
-
- radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
-
- frequencyRadioButtonsGroup.Add( radioButton );
- mFrequencyRadioButtons[0] = radioButton;
- }
-
- // Radio 2
- {
- Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_2_RADIO_TEXT );
- radioButton.SetName( FREQUENCY_2_RADIO_ID );
-
- radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
-
- radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
-
- frequencyRadioButtonsGroup.Add( radioButton );
- mFrequencyRadioButtons[1] = radioButton;
- }
-
- // Radio 3
- {
- Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_3_RADIO_TEXT );
- radioButton.SetName( FREQUENCY_3_RADIO_ID );
-
- radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
-
- frequencyRadioButtonsGroup.Add( radioButton );
- mFrequencyRadioButtons[2] = radioButton;
- }
-
- // Vsync group
- Toolkit::TableView vsyncGroupBackground = Toolkit::TableView::New( 1, 1 );
- vsyncGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- vsyncGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- vsyncGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
- vsyncGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
- vsyncGroupBackground.SetFitHeight( 0 );
-
- contentTable.Add( vsyncGroupBackground );
-
- {
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( VSYNC_BUTTON_ID );
- button.SetProperty( Toolkit::Button::Property::LABEL, VSYNC_BUTTON_TEXT);
- button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked );
-
- vsyncGroupBackground.Add( button );
- }
-
- WriteConsole();
- }
-
- void WriteConsole()
- {
- for( unsigned int i = 0; i < NUM_LOGGERS; ++i)
- {
- std::stringstream ss;
- ss << (i + 1) << ") " << ((mPerformanceLoggers[i]) ? "Created" : "Deleted")
- << ", " << ((mLoggerStates[i].isTiming) ? "Started" : "Stopped")
- << ", " << ((mLoggerStates[i].isEnabled) ? "Enabled" : "Disabled");
-
- mLogRadioButtons[i].SetProperty( Toolkit::Button::Property::LABEL, ss.str() );
- }
- }
-
- bool LoggingRadioSelect( Toolkit::Button button )
- {
- bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
- if( !isSelected )
- {
- return true;
- }
-
- if( button.GetName() == LOGGER_1_RADIO_ID )
- {
- mCurrentLogger = 0;
- }
- else if( button.GetName() == LOGGER_2_RADIO_ID )
- {
- mCurrentLogger = 1;
- }
- else if( button.GetName() == LOGGER_3_RADIO_ID )
- {
- mCurrentLogger = 2;
- }
-
- UpdateState();
-
- return true;
- }
-
- void UpdateState()
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- const unsigned int frequency = mLoggerStates[mCurrentLogger].frequency;
- if( frequency == HIGH_FREQUENCY )
- {
- mFrequencyRadioButtons[0].SetProperty( Toolkit::Button::Property::SELECTED, true );
- }
- else if( frequency == MEDIUM_FREQUENCY )
- {
- mFrequencyRadioButtons[1].SetProperty( Toolkit::Button::Property::SELECTED, true );
- }
- else if( frequency == LOW_FREQUENCY )
- {
- mFrequencyRadioButtons[2].SetProperty( Toolkit::Button::Property::SELECTED, true );
- }
- }
-
- bool FrequencyRadioSelect( Toolkit::Button button )
- {
- bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
- if( !isSelected )
- {
- return true;
- }
-
- if( button.GetName() == FREQUENCY_1_RADIO_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].SetLoggingFrequency( HIGH_FREQUENCY );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].frequency = HIGH_FREQUENCY;
- }
- }
- else if( button.GetName() == FREQUENCY_2_RADIO_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].SetLoggingFrequency( MEDIUM_FREQUENCY );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;
- }
- }
- else if( button.GetName() == FREQUENCY_3_RADIO_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].SetLoggingFrequency( LOW_FREQUENCY );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].frequency = LOW_FREQUENCY;
- }
- }
-
- return true;
- }
-
- void OnKeyEvent( const KeyEvent& event )
- {
- if( event.state == KeyEvent::Down )
- {
- if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
- {
- // Exit application when click back or escape.
- mApplication.Quit();
- }
- }
- }
-
- bool OnButtonClicked(Toolkit::Button button)
- {
- if( button.GetName() == CREATE_BUTTON_ID )
- {
- std::stringstream ss;
- ss << "Test logger " << (mCurrentLogger + 1);
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggerNames.size() );
- mPerformanceLoggerNames[mCurrentLogger] = ss.str();
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger] = Dali::PerformanceLogger::New( mPerformanceLoggerNames[mCurrentLogger].c_str() );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].isTiming = false;
- mLoggerStates[mCurrentLogger].isEnabled = true;
- mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;
-
- UpdateState();
- }
- else if ( button.GetName() == DELETE_BUTTON_ID )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].Reset();
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].isTiming = false;
- mLoggerStates[mCurrentLogger].isEnabled = true;
- mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;
-
- UpdateState();
- }
- else if ( button.GetName() == START_BUTTON_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].AddMarker( Dali::PerformanceLogger::START_EVENT );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].isTiming = true;
- }
- }
- else if ( button.GetName() == STOP_BUTTON_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].AddMarker( Dali::PerformanceLogger::END_EVENT );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].isTiming = false;
- }
- }
- else if ( button.GetName() == ENABLE_BUTTON_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].EnableLogging( true );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].isEnabled = true;
- }
- }
- else if ( button.GetName() == DISABLE_BUTTON_ID )
- {
- if( mPerformanceLoggers[mCurrentLogger] )
- {
- DALI_ASSERT_DEBUG( mCurrentLogger < mPerformanceLoggers.size() );
- mPerformanceLoggers[mCurrentLogger].EnableLogging( false );
-
- DALI_ASSERT_DEBUG( mCurrentLogger < mLoggerStates.size() );
- mLoggerStates[mCurrentLogger].isEnabled = false;
- }
- }
-
- WriteConsole();
-
- return true;
- }
-
-private:
-
- struct LoggerState
- {
- LoggerState() : frequency( 0 ), isTiming( false ), isEnabled( true ) {}
-
- unsigned int frequency;
- bool isTiming;
- bool isEnabled;
- };
-
- Application& mApplication;
- Toolkit::Control mView; ///< The View instance.
- Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
- Layer mContentLayer; ///< Content layer
-
- Animation mAnimation;
-
- typedef std::vector< std::string > Strings;
- Strings mPerformanceLoggerNames;
-
- typedef std::vector< Dali::PerformanceLogger > PerformanceLoggers;
- PerformanceLoggers mPerformanceLoggers;
- unsigned int mCurrentLogger;
-
- typedef std::vector< LoggerState > LoggerStates;
- LoggerStates mLoggerStates;
-
- typedef std::vector< Toolkit::RadioButton > RadioButtons;
- RadioButtons mLogRadioButtons;
- RadioButtons mFrequencyRadioButtons;
-};
-
-void RunTest( Application& application )
-{
- LoggingController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
-int DALI_EXPORT_API main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
- return 0;
-}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
};
-void RunTest( Application& application )
-{
- ExampleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ ExampleController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
Timer mMorphTimer;
};
-void RunTest( Application& application )
-{
- ExampleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ExampleController test( application );
+ application.MainLoop();
return 0;
}
+++ /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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/rendering/renderer.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <stdio.h>
-#include <sstream>
-#include <cstring>
-
-// INTERNAL INCLUDES
-#include "shared/view.h"
-#include "shared/utility.h"
-
-using namespace Dali;
-
-namespace
-{
-
-const char* IMAGES[] =
-{
- DEMO_IMAGE_DIR "people-medium-1.jpg",
- DEMO_IMAGE_DIR "people-medium-4.jpg",
- DEMO_IMAGE_DIR "people-medium-11.jpg",
- DEMO_IMAGE_DIR "people-small-16.jpg",
- DEMO_IMAGE_DIR "people-medium-15.jpg",
- DEMO_IMAGE_DIR "people-medium-6.jpg",
-};
-const unsigned int NUMBER_OF_SAMPLES(sizeof(IMAGES)/sizeof(const char*));
-
-
-#define MAKE_SHADER(A)#A
-
-const char* VERTEX_SHADER = MAKE_SHADER(
-uniform highp float uHue;
-attribute mediump vec2 aPosition;
-attribute highp vec2 aTexCoord;
-varying mediump vec2 vTexCoord;
-uniform mediump mat4 uMvpMatrix;
-uniform mediump vec3 uSize;
-varying mediump vec3 vGlobColor;
-
-vec3 hsv2rgb(vec3 c)
-{
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
- return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
-}
-
-void main()
-{
- mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
- vertexPosition.xyz *= uSize;
- vertexPosition = uMvpMatrix * vertexPosition;
- vGlobColor = hsv2rgb( vec3( clamp(uHue, 0.0, 1.0), 1.0, 1.0 ) );
-
- vTexCoord = aTexCoord;
- gl_Position = vertexPosition;
-}
-);
-
-const char* FRAGMENT_SHADER = MAKE_SHADER(
-varying mediump vec2 vTexCoord;
-varying mediump vec3 vGlobColor;
-uniform lowp vec4 uColor;
-uniform sampler2D sTexture;
-
-void main()
-{
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4(vGlobColor, 1.0) ;
-}
-);
-
-} // anonymous namespace
-
-// This example shows how to use a simple mesh
-//
-class ExampleController : public ConnectionTracker
-{
-public:
-
- /**
- * The example controller constructor.
- * @param[in] application The application instance
- */
- ExampleController( Application& application )
- : mApplication( application ),
- mZMode(0)
- {
- // Connect to the Application's Init signal
- mApplication.InitSignal().Connect( this, &ExampleController::Create );
- memset(mDepthIndices, 0, sizeof(mDepthIndices));
- }
-
- /**
- * The example controller destructor
- */
- ~ExampleController()
- {
- // Nothing to do here;
- }
-
- /**
- * Invoked upon creation of application
- * @param[in] application The application instance
- */
- void Create( Application& application )
- {
- Stage stage = Stage::GetCurrent();
- stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);
-
- mStageSize = stage.GetSize();
-
- // The Init signal is received once (only) during the Application lifetime
-
- // Hide the indicator bar
- application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
-
- mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
- mGeometry = DemoHelper::CreateTexturedQuad();
-
- TextureSet firstTextureSet;
-
- for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)
- {
- Texture texture = DemoHelper::LoadTexture( IMAGES[i] );
- TextureSet textureSet = TextureSet::New();
- textureSet.SetTexture( 0u, texture );
- if( i==0 ) { firstTextureSet = textureSet; }
-
- Renderer renderer = Renderer::New( mGeometry, mShader );
- renderer.SetTextures( textureSet );
- Actor meshActor = Actor::New();
- mActors[i] = meshActor;
- meshActor.AddRenderer( renderer );
- meshActor.SetSize(175, 175);
- meshActor.RegisterProperty("index", (int)i);
-
- renderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- // Test with actor alpha
- meshActor.SetParentOrigin( ParentOrigin::CENTER );
- meshActor.SetAnchorPoint( AnchorPoint::CENTER );
- meshActor.SetPosition( 40.0f*(i-(NUMBER_OF_SAMPLES*0.5f)), 40.0f*(i-(NUMBER_OF_SAMPLES*0.5f)), i*10 );
-
- meshActor.SetOpacity( i%2?0.7f:1.0f );
-
- meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES);
-
- meshActor.TouchSignal().Connect(this, &ExampleController::OnTouched);
- std::ostringstream oss;
- oss << "Mesh Actor " << i;
- meshActor.SetName(oss.str());
- stage.Add( meshActor );
- }
-
- mActors[NUMBER_OF_SAMPLES-2].GetRendererAt(0).SetTextures( firstTextureSet );
-
- stage.GetRootLayer().TouchSignal().Connect(this, &ExampleController::OnStageTouched);
- }
-
- void PrintDepths()
- {
- switch( mZMode )
- {
- case 0:
- {
- printf("Children Z ordered back to front\n");
- break;
- }
- case 1:
- {
- printf("All children set to same Z=0\n");
- break;
- }
- case 2:
- {
- printf("Children Z ordered front to back\n");
- break;
- }
- }
-
- for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)
- {
- printf("DepthIndex[%d]=%d\n", i, mDepthIndices[i]);
- }
- printf("\n");
- }
-
- bool OnTouched( Actor actor, const TouchData& event )
- {
- if( event.GetState( 0 ) == PointState::UP )
- {
- int index = actor.GetProperty<int>(actor.GetPropertyIndex("index"));
-
- int newDepthIndex = (mDepthIndices[index] + 10) % 30;
- mDepthIndices[index] = newDepthIndex;
-
- Renderer renderer = actor.GetRendererAt(0);
- renderer.SetProperty( Renderer::Property::DEPTH_INDEX, newDepthIndex);
-
- PrintDepths();
- }
- return true;
- }
-
- bool OnStageTouched( Actor rootLayer, const TouchData& event )
- {
- if( event.GetState( 0 ) == PointState::UP )
- {
- switch( mZMode )
- {
- case 0:
- {
- mZMode = 1;
- for(unsigned int i=1; i < rootLayer.GetChildCount(); ++i)
- {
- Actor child = rootLayer.GetChildAt(i);
- child.SetZ( 0.0f );
- }
- PrintDepths();
- break;
- }
- case 1:
- {
- mZMode = 2;
- for(unsigned int i=1; i < rootLayer.GetChildCount(); ++i)
- {
- Actor child = rootLayer.GetChildAt(i);
- child.SetZ( 100-i*10 );
- }
- PrintDepths();
- break;
- }
- case 2:
- {
- mZMode = 0;
- for(unsigned int i=1; i < rootLayer.GetChildCount(); ++i)
- {
- Actor child = rootLayer.GetChildAt(i);
- child.SetZ( i*10 );
- }
- PrintDepths();
- break;
- }
- }
- }
- return true;
- }
-
- /**
- * Invoked whenever the quit button is clicked
- * @param[in] button the quit button
- */
- bool OnQuitButtonClicked( Toolkit::Button button )
- {
- // quit the application
- mApplication.Quit();
- return true;
- }
-
- void OnKeyEvent(const KeyEvent& event)
- {
- if(event.state == KeyEvent::Down)
- {
- if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
- {
- mApplication.Quit();
- }
- }
- }
-
-private:
-
- Application& mApplication; ///< Application instance
- Vector3 mStageSize; ///< The size of the stage
-
- Shader mShader;
- Geometry mGeometry;
-
- int mDepthIndices[NUMBER_OF_SAMPLES];
- Actor mActors[NUMBER_OF_SAMPLES];
- int mZMode;
-};
-
-void RunTest( Application& application )
-{
- ExampleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
-int DALI_EXPORT_API main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
- return 0;
-}
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/property-map.h>
-#include <dali-toolkit/devel-api/align-enums.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
}
Property::Map lightMap;
- lightMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
+ lightMap.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE );
lightMap.Insert( ImageVisual::Property::URL, imageUrl );
mLightSource.SetProperty( Control::Property::BACKGROUND, Property::Value( lightMap ) );
}
{
//Create mesh property map
Property::Map map;
- map.Insert( Visual::Property::TYPE, Visual::MESH );
- map.Insert( DevelVisual::Property::TRANSFORM,
- Property::Map().Add( DevelVisual::Transform::Property::ORIGIN, Align::CENTER )
- .Add( DevelVisual::Transform::Property::ANCHOR_POINT, Align::CENTER ) );
+ map.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
+ map.Insert( Visual::Property::TRANSFORM,
+ Property::Map().Add( Visual::Transform::Property::ORIGIN, Align::CENTER )
+ .Add( Visual::Transform::Property::ANCHOR_POINT, Align::CENTER ) );
map.Insert( MeshVisual::Property::OBJECT_URL, MODEL_FILE_TABLE[mModelIndex] );
map.Insert( MeshVisual::Property::MATERIAL_URL, MATERIAL_FILE_TABLE[mModelIndex] );
map.Insert( MeshVisual::Property::TEXTURES_PATH, TEXTURES_PATH );
bool mLightFront; //Bool for light being in front or behind the models.
};
-// Entry point for Linux & Tizen applications
-//
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
MeshVisualController test( application );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
bool mScaled;
};
-void RunTest( Application& application )
-{
- Model3dViewController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ Model3dViewController test( application );
+ application.MainLoop();
return 0;
}
Animation mRotateAnimation; ///< Animation for rotating between landscape and portrait.
};
-void RunTest(Application& app)
-{
- MotionBlurExampleApp test(app);
-
- app.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ MotionBlurExampleApp test(app);
+ app.MainLoop();
return 0;
}
};
-void RunTest(Application& app)
-{
- MotionStretchExampleApp test(app);
-
- app.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ MotionStretchExampleApp test(app);
+ app.MainLoop();
return 0;
}
// EXTERNAL INCLUDES
#include <dali/dali.h>
#include <dali/devel-api/images/native-image-interface-extension.h>
-#include <dali/public-api/rendering/renderer.h>
-#include <dali/public-api/rendering/frame-buffer.h>
#include <dali-toolkit/dali-toolkit.h>
#include <cstring>
bool mRefreshAlways;
};
-void RunTest( Application& application )
-{
- NativeImageSourceController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ NativeImageSourceController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
#include "shared/utility.h"
Animation mHide;
};
-void RunTest( Application& application )
-{
- PerfScroll test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
}
}
- RunTest( application );
+ PerfScroll test( application );
+ application.MainLoop();
return 0;
}
void OnTap( Actor actor, const TapGesture& /* tap */ )
{
// Raise the actor to the top.
- DevelActor::RaiseToTop( actor );
+ actor.RaiseToTop();
// Create the animation to rotate and scale our actor.
Animation animation = Animation::New( 1.0f );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
Timer mChangeImageTimer;
};
-void RunTest( Application& application )
-{
- ExampleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ExampleController test( application );
+ application.MainLoop();
return 0;
}
};
-void RunTest( Application& application )
-{
- PopupExample test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ PopupExample test( application );
+ application.MainLoop();
return 0;
}
*/
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/property-map.h>
-#include <dali-toolkit/devel-api/align-enums.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/controls/slider/slider.h>
using namespace Dali;
using namespace Dali::Toolkit;
//Visual map for model
mVisualMap.Clear();
- mVisualMap[ Visual::Property::TYPE ] = Visual::PRIMITIVE;
+ mVisualMap[ Toolkit::Visual::Property::TYPE ] = Visual::PRIMITIVE;
mVisualMap[ PrimitiveVisual::Property::MIX_COLOR ] = mColor;
- mVisualMap[ DevelVisual::Property::TRANSFORM ] =
- Property::Map().Add( DevelVisual::Transform::Property::ORIGIN, Align::CENTER )
- .Add( DevelVisual::Transform::Property::ANCHOR_POINT, Align::CENTER );
+ mVisualMap[ Visual::Property::TRANSFORM ] =
+ Property::Map().Add( Visual::Transform::Property::ORIGIN, Align::CENTER )
+ .Add( Visual::Transform::Property::ANCHOR_POINT, Align::CENTER );
}
//Sets the 3D model to a sphere and modifies the sliders appropriately.
Vector2 mRotation; ///< Keeps track of model rotation.
};
-void RunTest( Application& application )
+int DALI_EXPORT_API main( int argc, char **argv )
{
+ Application application = Application::New( &argc, &argv );
PrimitiveShapesController test( application );
-
application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
-int main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "shared/view.h"
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/progress-bar/progress-bar.h>
using namespace Dali;
using namespace Dali::Toolkit;
#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
mTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mTextLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
mTextLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
- mTextLabel.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE, Color::BLACK );
+ mTextLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK );
stage.Add( mTextLabel );
// Create an animation and animate the text color to red
Animation animation = Animation::New( COLOR_ANIMATION_DURATION );
- animation.AnimateTo( Property( mTextLabel, DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ), Color::RED );
+ animation.AnimateTo( Property( mTextLabel, TextLabel::Property::TEXT_COLOR ), Color::RED );
animation.Play();
// Set up a property notification so we are notified when the red component of the text-color reaches 50%
- PropertyNotification notification = mTextLabel.AddPropertyNotification( DevelTextLabel::Property::TEXT_COLOR_RED, GreaterThanCondition( 0.5f ) );
+ PropertyNotification notification = mTextLabel.AddPropertyNotification( TextLabel::Property::TEXT_COLOR_RED, GreaterThanCondition( 0.5f ) );
notification.NotifySignal().Connect( this, &PropertyNotificationController::RedComponentNotification );
}
ToolBar mToolBar;
};
-void RunTest( Application& application )
-{
- RayMarchingExample test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ RayMarchingExample test( application );
+ application.MainLoop();
return 0;
}
// EXTERNAL INCLUDES
#include <dali/dali.h>
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
/*****************************************************************************/
-static void
-RunTest(Application& app)
-{
- RefractionEffectExample theApp(app);
- app.MainLoop();
-}
-
-/*****************************************************************************/
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ RefractionEffectExample theApp(app);
+ app.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
};
-void RunTest(Application &application)
-{
- MyTester test(application);
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
int DALI_EXPORT_API main(int argc, char **argv)
{
-
Application application = Application::New(&argc, &argv, "");
- RunTest(application);
-
+ MyTester test(application);
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Actor mCubes[2]; ///< The cube object containers
};
-
-/**
- * @brief Creates an instance of the example object and runs it.
- * @param[in] application The DALi application object
- */
-void RunExample( Application& application )
-{
- RendererStencilExample example( application );
-
- application.MainLoop();
-}
-
-/**
- * @brief Entry point for Linux & Tizen applications
- * @param[in] argc The executables argument count
- * @param[in] argv The executables argument vector
- * @return The executables exit code (0)
- */
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunExample( application );
-
+ RendererStencilExample example( application );
+ application.MainLoop();
return 0;
}
Animation mAnimation;
};
-void RunTest( Application& application )
-{
- BasicLightController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, BASIC_LIGHT_THEME);
-
- RunTest( application );
-
+ BasicLightController test( application );
+ application.MainLoop();
return 0;
}
#include "ktx-loader.h"
// EXTERNAL INCLUDES
-#include <dali/devel-api/images/pixel-devel.h>
-#include <dali/devel-api/images/pixel-data-devel.h>
#include <memory.h>
#include <stdio.h>
#include <stdint.h>
/**
* Convert KTX format to Dali::Pixel::Format
*/
-bool ConvertPixelFormat(const uint32_t ktxPixelFormat, Dali::DevelPixel::Format& format)
+bool ConvertPixelFormat(const uint32_t ktxPixelFormat, Dali::Pixel::Format& format)
{
switch( ktxPixelFormat )
{
case 0x93B0: // GL_COMPRESSED_RGBA_ASTC_4x4_KHR
{
- format = Dali::DevelPixel::COMPRESSED_RGBA_ASTC_4x4_KHR;
+ format = Dali::Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
case 0x881B:// GL_RGB16F
{
- format = Dali::DevelPixel::RGB16F;
+ format = Dali::Pixel::RGB16F;
break;
}
case 0x8815: // GL_RGB32F
{
- format = Dali::DevelPixel::RGB32F;
+ format = Dali::Pixel::RGB32F;
break;
}
case 0x8C3A: // GL_R11F_G11F_B10F
{
- format = Dali::DevelPixel::RGB32F;
+ format = Dali::Pixel::RGB32F;
break;
}
case 0x8D7C: // GL_RGBA8UI
{
- format = Dali::DevelPixel::RGBA8888;
+ format = Dali::Pixel::RGBA8888;
break;
}
case 0x8D7D: // GL_RGB8UI
{
- format = Dali::DevelPixel::RGB888;
+ format = Dali::Pixel::RGB888;
break;
}
default:
header.pixelHeight = 1u;
}
- Dali::DevelPixel::Format daliformat = DevelPixel::RGB888;
+ Dali::Pixel::Format daliformat = Pixel::RGB888;
ConvertPixelFormat(header.glInternalFormat, daliformat);
memcpy(img[face],imgPointer,byteSize);
imgSize[face] = byteSize;
imgPointer += byteSize;
- cubedata.img[face][mipmapLevel] = DevelPixelData::New( img[face], imgSize[face], header.pixelWidth , header.pixelHeight , daliformat, PixelData::FREE );
+ cubedata.img[face][mipmapLevel] = PixelData::New( img[face], imgSize[face], header.pixelWidth , header.pixelHeight , daliformat, PixelData::FREE );
}
}
header.pixelHeight/=2u;
};
-void RunTest( Application& application )
-{
- BasicPbrController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv);
-
- RunTest( application );
-
+ BasicPbrController test( application );
+ application.MainLoop();
return 0;
}
Animation mAnimation;
};
-void RunTest( Application& application )
-{
- DrawCubeController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ DrawCubeController test( application );
+ application.MainLoop();
return 0;
}
Actor mActor;
};
-void RunTest( Application& application )
-{
- DrawLineController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ DrawLineController test( application );
+ application.MainLoop();
return 0;
}
Stage stage = Stage::GetCurrent();
stage.SetBackgroundColor( Color::BLACK );
+ // Connect to the stage's key signal to allow Back and Escape to exit.
+ stage.KeyEventSignal().Connect( this, &RadialProgressController::OnKeyEvent );
+
// 1. Create actor to show the effect
mActor = Actor::New();
mActor.SetAnchorPoint( AnchorPoint::CENTER );
return renderer;
}
+ /**
+ * @brief Called when any key event is received
+ *
+ * Will use this to quit the application if Back or the Escape key is received
+ * @param[in] event The key event information
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
private:
Application& mApplication;
Actor mActor;
};
-void RunTest( Application& application )
-{
- RadialProgressController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ RadialProgressController test( application );
+ application.MainLoop();
return 0;
}
Actor mSkyboxActor;
};
-void RunTest( Application& application )
-{
- TexturedCubeController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ TexturedCubeController test( application );
+ application.MainLoop();
return 0;
}
Animation mAnimation;
};
-void RunTest( Application& application )
-{
- TexturedCubeController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ TexturedCubeController test( application );
+ application.MainLoop();
return 0;
}
Actor mActor;
};
-void RunTest( Application& application )
-{
- DrawTriangleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ DrawTriangleController test( application );
+ application.MainLoop();
return 0;
}
/*****************************************************************************/
-static void
-RunTest(Application& app)
-{
- TestApp theApp(app);
- app.MainLoop();
-}
-
-/*****************************************************************************/
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ TestApp theApp(app);
+ app.MainLoop();
return 0;
}
// EXTERNAL INCLUDES
-#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
using namespace Dali;
// EXTERNAL INCLUDES
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <cstdio>
const char* SIMPLE_DEMO_THEME( DEMO_STYLE_DIR "simple-example-theme.json" );
}
-/// Entry point for applications
int DALI_EXPORT_API main( int argc, char** argv )
{
Application application = Application::New( &argc, &argv, SIMPLE_DEMO_THEME ); // Use the above defined style sheet for this application.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
};
-void RunTest( Application& application )
-{
- SizeNegotiationController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ SizeNegotiationController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::map< Animation, int > mTapAnimationIndexPair;
};
-void RunTest( Application& application )
-{
- SparkleEffectExample theApp( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ SparkleEffectExample theApp( application );
+ application.MainLoop();
return 0;
}
#include "image-channel-control-impl.h"
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali-toolkit/devel-api/align-enums.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <cstdio>
+
using namespace Dali; // Needed for macros
namespace Demo
Vector2 size( targetSize );
Property::Map transformMap;
transformMap
- .Add( Toolkit::DevelVisual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) )
- .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
- .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
- .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
- .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) )
- .Add( Toolkit::DevelVisual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) );
+ .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) )
+ .Add( Toolkit::Visual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
+ .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
+ .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
+ .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE ) )
+ .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE ) );
mVisual.SetTransformAndSize( transformMap, size );
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "styling-application.h"
-/// Entry point for applications
int DALI_EXPORT_API main( int argc, char** argv )
{
const char* themeName = Demo::StylingApplication::DEMO_THEME_ONE_PATH;
// External includes
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
#include "image-channel-control.h"
#include <cstdio>
#include <sstream>
// Add border to highlight harder-to-see colors.
// We use a color rather than border visual as the container will always be behind the button.
Property::Map colorMap;
- colorMap.Insert( Visual::Property::TYPE, Visual::COLOR);
+ colorMap.Insert( Toolkit::Visual::Property::TYPE, Visual::COLOR);
colorMap.Insert( ColorVisual::Property::MIX_COLOR, Color::BLACK );
mColorContainer.SetProperty( Control::Property::BACKGROUND, colorMap );
void SetButtonColor( Button& button, const Vector4& color )
{
Property::Map colorVisualMap;
- colorVisualMap.Add( Visual::Property::TYPE, Visual::COLOR )
+ colorVisualMap.Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
.Add( ColorVisual::Property::MIX_COLOR, color );
button.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, colorVisualMap );
Toolkit::TableView mButtonContainer;
};
-void RunTest( Application& application )
-{
- TextEditorExample test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
// DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet.
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ TextEditorExample test( application );
+ application.MainLoop();
return 0;
}
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
#include <iostream>
-#include <dali/public-api/events/touch-point.h>
// INTERNAL INCLUDES
#include "shared/multi-language-strings.h"
Popup mPopup;
};
-void RunTest( Application& application )
-{
- TextFieldExample test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
int DALI_EXPORT_API main( int argc, char **argv )
{
// DALI_DEMO_THEME_PATH not passed to Application so TextField example uses default Toolkit style sheet.
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ TextFieldExample test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
bool mToggle;
};
-void RunTest( Application& application )
-{
- TextFontsExample test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ TextFontsExample test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
float mLastPoint;
};
-void RunTest( Application& application )
-{
- EmojiExample test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ EmojiExample test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
float mLastPoint;
};
-void RunTest( Application& application )
-{
- TextLabelMultiLanguageExample test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ TextLabelMultiLanguageExample test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/devel-api/object/handle-devel.h>
#include <dali/devel-api/actors/actor-devel.h>
-#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <iostream>
mLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
mLabel.SetSize(mLayoutSize);
mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
- mLabel.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE, Color::GREEN );
+ mLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
mLabel.SetBackgroundColor( Color::WHITE );
mContainer.Add( mLabel );
mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
Dali::Property::Map border;
- border.Insert( Visual::Property::TYPE, Visual::BORDER );
+ border.Insert( Toolkit::Visual::Property::TYPE, Visual::BORDER );
border.Insert( BorderVisual::Property::COLOR, Color::WHITE );
border.Insert( BorderVisual::Property::SIZE, 2.f );
mBorder.SetProperty( Control::Property::BACKGROUND, border );
mContainer.Add( mBorder );
mBorder.SetVisible(false);
- DevelActor::RaiseToTop(mGrabCorner);
+ mGrabCorner.RaiseToTop();
mHueAngleIndex = mLabel.RegisterProperty( "hue", 0.0f );
Renderer bgRenderer = mLabel.GetRendererAt(0);
// Animate the text color 3 times from source color to Yellow
Animation animation = Animation::New( 2.f );
- animation.AnimateTo( Property( mLabel, DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ), Color::YELLOW, AlphaFunction::SIN );
+ animation.AnimateTo( Property( mLabel, TextLabel::Property::TEXT_COLOR ), Color::YELLOW, AlphaFunction::SIN );
animation.SetLoopCount( 3 );
animation.Play();
if( button == mStyleButtons[ StyleType::TEXT_COLOR ] )
{
Animation animation = Animation::New( 2.f );
- animation.AnimateTo( Property( mLabel, DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ), mSelectedColor, AlphaFunction::LINEAR );
+ animation.AnimateTo( Property( mLabel, TextLabel::Property::TEXT_COLOR ), mSelectedColor, AlphaFunction::LINEAR );
animation.Play();
}
else if( button == mStyleButtons[ StyleType::OUTLINE ] )
mColorButtons[index].SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, propertyMap );
mColorButtons[index].SetProperty( Toolkit::DevelButton::Property::SELECTED_VISUAL,
- Property::Map().Add( Visual::Property::TYPE, Visual::BORDER )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::BORDER )
.Add( BorderVisual::Property::COLOR, Color::WHITE )
.Add( BorderVisual::Property::SIZE, 2.0f )
.Add( BorderVisual::Property::ANTI_ALIASING, true ) );
case KEY_A: // Animate text colour
{
Animation animation = Animation::New( 2.f );
- animation.AnimateTo( Property( mLabel, DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ), Color::RED, AlphaFunction::SIN );
+ animation.AnimateTo( Property( mLabel, TextLabel::Property::TEXT_COLOR ), Color::RED, AlphaFunction::SIN );
animation.SetLoopCount( 3 );
animation.Play();
break;
Property::Index mOverrideMixColorIndex;
};
-void RunTest( Application& application )
-{
- TextLabelExample test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ TextLabelExample test( application );
+ application.MainLoop();
return 0;
}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file text-memory-profiling-example.cpp
+ * @brief Memory consumption profiling for TextLabel
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
+
+// INTERNAL INCLUDES
+#include "shared/view.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+enum TextType
+{
+ SINGLE_COLOR_TEXT,
+ SINGLE_COLOR_TEXT_WITH_STYLE,
+ SINGLE_COLOR_TEXT_WITH_EMOJI,
+ SINGLE_COLOR_TEXT_WITH_STYLE_EMOJI,
+ MULTI_COLOR_TEXT,
+ MULTI_COLOR_TEXT_WITH_STYLE,
+ MULTI_COLOR_TEXT_WITH_EMOJI,
+ MULTI_COLOR_TEXT_WITH_STYLE_EMOJI,
+ NUMBER_OF_TYPES
+};
+
+std::string TEXT_TYPE_STRING[ NUMBER_OF_TYPES ] =
+{
+ "Single color text",
+ "Single color text with style",
+ "Single color text with emoji",
+ "Single color text with style and emoji",
+ "Multi color text",
+ "Multi color text with style",
+ "Multi color text with emoji",
+ "Multi color text with style and emoji"
+};
+
+const int NUMBER_OF_LABELS = 500;
+
+const char* BACKGROUND_IMAGE( "" );
+const char* TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
+const char* BACK_IMAGE( DEMO_IMAGE_DIR "icon-change.png" );
+const char* BACK_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-change-selected.png" );
+const char* INDICATOR_IMAGE( DEMO_IMAGE_DIR "loading.png" );
+
+} // anonymous namespace
+
+/**
+ * @brief The main class of the demo.
+ */
+class TextMemoryProfilingExample : public ConnectionTracker, public Toolkit::ItemFactory
+{
+public:
+
+ TextMemoryProfilingExample( Application& application )
+ : mApplication( application ),
+ mCurrentTextStyle( SINGLE_COLOR_TEXT )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &TextMemoryProfilingExample::Create );
+ }
+
+ ~TextMemoryProfilingExample()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * @brief Create a text label in the given type
+ */
+ TextLabel SetupTextLabel( int type )
+ {
+ TextLabel label = TextLabel::New();
+ label.SetAnchorPoint( ParentOrigin::TOP_LEFT );
+ label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f );
+ label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::YELLOW );
+ label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
+
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+ label.SetPosition( Vector3( Random::Range( 0.0f, stageSize.x ), Random::Range( 0.0f, stageSize.y ), 0.0f) );
+
+ switch ( type )
+ {
+ case SINGLE_COLOR_TEXT:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+ break;
+ }
+ case SINGLE_COLOR_TEXT_WITH_STYLE:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+ break;
+ }
+ case SINGLE_COLOR_TEXT_WITH_EMOJI:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+ break;
+ }
+ case SINGLE_COLOR_TEXT_WITH_STYLE_EMOJI:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 A Quick Brown Fox Jumps Over The Lazy Dog" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+ break;
+ }
+ case MULTI_COLOR_TEXT:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+ break;
+ }
+ case MULTI_COLOR_TEXT_WITH_STYLE:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, "A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+ break;
+ }
+ case MULTI_COLOR_TEXT_WITH_EMOJI:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, " \xF0\x9F\x98\x81 A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.0f, 0.0f ) );
+ break;
+ }
+ case MULTI_COLOR_TEXT_WITH_STYLE_EMOJI:
+ {
+ label.SetProperty( TextLabel::Property::TEXT, " \xF0\x9F\x98\x81 A <color value='cyan'>Quick Brown Fox</color> Jumps Over The <color value='yellow'>Lazy Dog</color>" );
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+ break;
+ }
+ default:
+ break;
+ }
+
+ return label;
+ }
+
+ /**
+ * @brief Create the main menu
+ */
+ void CreateMainMenu()
+ {
+ Stage stage = Stage::GetCurrent();
+ Vector2 stageSize = stage.GetSize();
+
+ mTapDetector = TapGestureDetector::New();
+ mTapDetector.DetectedSignal().Connect( this, &TextMemoryProfilingExample::OnTap );
+
+ // Create an item view for the main menu
+ mItemView = ItemView::New( *this );
+
+ mItemView.SetParentOrigin( ParentOrigin::CENTER );
+ mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+
+ mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
+ mLayout->SetItemSize( Vector3( stageSize.width, 60.0f, 0.0f ) );
+
+ mItemView.AddLayout( *mLayout );
+
+ // Activate the layout
+ mItemView.ActivateLayout( 0, Vector3( stageSize ), 0.0f );
+ }
+
+ /**
+ * @brief Return the number of items in the main menu
+ */
+ virtual unsigned int GetNumberOfItems()
+ {
+ return NUMBER_OF_TYPES;
+ }
+
+ /**
+ * @brief Create new item for the main menu
+ */
+ virtual Actor NewItem( unsigned int itemId )
+ {
+ TextLabel label = TextLabel::New( TEXT_TYPE_STRING[itemId] );
+ label.SetStyleName( "BuilderLabel" );
+ label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+
+ // Hook up tap detector
+ mTapDetector.Attach( label );
+
+ return label;
+ }
+
+ /**
+ * @brief Create text labels for memory profiling
+ */
+ void CreateTextLabels( int type )
+ {
+ Stage stage = Stage::GetCurrent();
+
+ // Render tasks may have been setup last load so remove them
+ RenderTaskList taskList = stage.GetRenderTaskList();
+ if( taskList.GetTaskCount() > 1 )
+ {
+ typedef std::vector<RenderTask> Collection;
+ typedef Collection::iterator ColIter;
+ Collection tasks;
+
+ for( unsigned int i = 1; i < taskList.GetTaskCount(); ++i )
+ {
+ tasks.push_back( taskList.GetTask(i) );
+ }
+
+ for( ColIter iter = tasks.begin(); iter != tasks.end(); ++iter )
+ {
+ taskList.RemoveTask(*iter);
+ }
+
+ RenderTask defaultTask = taskList.GetTask( 0 );
+ defaultTask.SetSourceActor( stage.GetRootLayer() );
+ defaultTask.SetTargetFrameBuffer( FrameBufferImage() );
+ }
+
+ // Delete any existing text labels
+ unsigned int numChildren = mLayer.GetChildCount();
+
+ for( unsigned int i = 0; i < numChildren; ++i )
+ {
+ mLayer.Remove( mLayer.GetChildAt( 0 ) );
+ }
+
+ mLayer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ mLayer.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ mLayer.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::HEIGHT );
+ mLayer.SetSizeModeFactor( Vector3( 0.0f, -DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight, 0.0f ) );
+
+ mNavigationView.Push( mLayer );
+
+ // Create new text labels
+ for ( int i = 0; i < NUMBER_OF_LABELS; i++ )
+ {
+ TextLabel label = SetupTextLabel( type );
+ mLayer.Add( label );
+ }
+
+ mTitle.SetProperty( TextLabel::Property::TEXT, "Run memps on target" );
+ }
+
+ /**
+ * @brief One-time setup in response to Application InitSignal.
+ */
+ void Create( Application& application )
+ {
+ Stage stage = Stage::GetCurrent();
+
+ stage.KeyEventSignal().Connect(this, &TextMemoryProfilingExample::OnKeyEvent);
+
+ Layer contents = DemoHelper::CreateView( mApplication,
+ mView,
+ mToolBar,
+ BACKGROUND_IMAGE,
+ TOOLBAR_IMAGE,
+ "" );
+
+ mTitle = DemoHelper::CreateToolBarLabel( "" );
+ mTitle.SetProperty( TextLabel::Property::TEXT, "Select the type of text" );
+
+ // Add title to the tool bar.
+ mToolBar.AddControl( mTitle, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
+
+ // Create a layer to contain dynamically created text labels
+ mLayer = Layer::New();
+
+ mIndicator = Toolkit::ImageView::New(INDICATOR_IMAGE);
+ mIndicator.SetParentOrigin( ParentOrigin::CENTER );
+ mIndicator.SetAnchorPoint( AnchorPoint::CENTER );
+ mIndicator.SetProperty( Actor::Property::VISIBLE, false );
+
+ // Create a back button in the left of toolbar
+ PushButton backButton = PushButton::New();
+ backButton.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BACK_IMAGE );
+ backButton.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BACK_IMAGE_SELECTED );
+ backButton.ClickedSignal().Connect( this, &TextMemoryProfilingExample::OnBackButtonPressed );
+ backButton.SetLeaveRequired( true );
+ mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
+
+ // Create a navigation view to navigate different types of text labels
+ mNavigationView = NavigationView::New();
+ mNavigationView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mNavigationView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mNavigationView.SetBackgroundColor( Color::WHITE );
+ stage.Add( mNavigationView );
+
+ CreateMainMenu();
+ mNavigationView.Push( mItemView );
+
+ mItemView.Add(mIndicator);
+
+ PropertyNotification notification = mIndicator.AddPropertyNotification( Actor::Property::VISIBLE, GreaterThanCondition(0.01f) );
+ notification.NotifySignal().Connect( this, &TextMemoryProfilingExample::OnIndicatorVisible );
+ }
+
+ /**
+ * @brief Main key event handler
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+ {
+ ReturnToPreviousScreen();
+ }
+ }
+ }
+
+ /**
+ * @brief Tap gesture handler
+ */
+ void OnTap( Actor actor, const TapGesture& tap )
+ {
+ mCurrentTextStyle = mItemView.GetItemId( actor );
+
+ // Show the loading indicator
+ mIndicator.SetProperty( Actor::Property::VISIBLE, true );
+
+ if ( mAnimation )
+ {
+ mAnimation.Clear();
+ mAnimation.Reset();
+ }
+
+ mAnimation = Animation::New( 0.8f );
+ mAnimation.AnimateBy( Property( mIndicator, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(180.0f) ), Vector3::ZAXIS ) );
+ mAnimation.SetLooping( true );
+ mAnimation.Play();
+ }
+
+ /**
+ * @brief Property notification handler
+ */
+ void OnIndicatorVisible( PropertyNotification& source )
+ {
+ CreateTextLabels( mCurrentTextStyle );
+
+ // Hide the loading indicator
+ mAnimation.Stop();
+ mIndicator.SetProperty( Actor::Property::VISIBLE, false );
+ }
+
+ /**
+ * @brief Button signal handler
+ */
+ bool OnBackButtonPressed( Toolkit::Button button )
+ {
+ ReturnToPreviousScreen();
+ return true;
+ }
+
+ /**
+ * @brief Returns to the previous screen
+ */
+ void ReturnToPreviousScreen()
+ {
+ if ( mItemView.OnStage() )
+ {
+ // Quit the application if it is in the main menu
+ mApplication.Quit();
+ }
+ else
+ {
+ // Return to the main menu
+ mNavigationView.Pop();
+
+ mTitle.SetProperty( TextLabel::Property::TEXT, "Select type of text to test" );
+ }
+ }
+
+private:
+
+ Application& mApplication;
+
+ ItemLayoutPtr mLayout;
+ ItemView mItemView;
+ NavigationView mNavigationView;
+
+ Control mView;
+ ToolBar mToolBar;
+ TextLabel mTitle;
+ ImageView mIndicator;
+ Animation mAnimation;
+
+ Layer mLayer;
+
+ TapGestureDetector mTapDetector;
+
+ unsigned int mCurrentTextStyle;
+};
+
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
+ TextMemoryProfilingExample test( application );
+ application.MainLoop();
+ return 0;
+}
bool TextOverlapController::OnClicked( Button button )
{
mTopmostLabel = 1-mTopmostLabel; // toggles between 0 and 1
- DevelActor::RaiseToTop(mLabels[mTopmostLabel]);
+ mLabels[mTopmostLabel].RaiseToTop();
return false;
}
} // namespace Demo
-
-int main( int argc, char** argv )
+int DALI_EXPORT_API main( int argc, char** argv )
{
{
Application app = Application::New( &argc, &argv );
// EXTERNAL INCLUDES
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
-#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
parent.Add( box );
Dali::Property::Map border;
- border.Insert( Visual::Property::TYPE, Visual::BORDER );
+ border.Insert( Toolkit::Visual::Property::TYPE, Visual::BORDER );
border.Insert( BorderVisual::Property::COLOR, Color::BLUE );
border.Insert( BorderVisual::Property::SIZE, 1.f );
box.SetProperty( Control::Property::BACKGROUND, border );
Toolkit::PushButton scrollRtlButton = Toolkit::PushButton::New();
scrollRtlButton.ClickedSignal().Connect( this, &TextScrollingExample::OnButtonClickedRtl );
CreateLabel( mRtlLabel, "مرحبا بالعالم", boxD , true, scrollRtlButton );
- mRtlLabel.SetProperty(DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
- mRtlLabel.SetProperty(DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY, 0.3f );
+ mRtlLabel.SetProperty(TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
+ mRtlLabel.SetProperty(TextLabel::Property::AUTO_SCROLL_LOOP_DELAY, 0.3f );
CreateBox( "boxE", boxE, desktop, SCROLLING_BOX_SIZE );
boxE.SetPosition( 0.0f, -100.0f, 1.0f );
mRtlLongLabel.SetProperty(TextLabel::Property::AUTO_SCROLL_SPEED, 500);
mRtlLongLabel.SetProperty(TextLabel::Property::AUTO_SCROLL_GAP, 500);
mRtlLongLabel.SetProperty(TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3);
- mRtlLongLabel.SetProperty(DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+ mRtlLongLabel.SetProperty(TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
mPanGestureDetector = PanGestureDetector::New();
mPanGestureDetector.DetectedSignal().Connect(this, &TextScrollingExample::OnPanGesture );
Toolkit::PushButton colorButton = Toolkit::PushButton::New();
colorButton.SetProperty( Button::Property::TOGGLABLE, true );
- colorButton.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
- colorButton.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::BLACK ) );
+ colorButton.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
+ colorButton.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::BLACK ) );
colorButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
colorButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
colorButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
bool mToggleColor;
};
-void RunTest( Application& application )
-{
- TextScrollingExample test( application );
-
- application.MainLoop();
-}
-
-/** Entry point for Linux & Tizen applications */
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ TextScrollingExample test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
Timer mChangeImageTimer;
};
-void RunTest( Application& application )
-{
- ExampleController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
+ ExampleController test( application );
+ application.MainLoop();
return 0;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
TextLabel mTextLabel;
};
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/tooltip/tooltip-properties.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
Layout( customFromCode, stageSize );
customFromCode.SetProperty( DevelControl::Property::TOOLTIP,
Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Array().Add( Property::Map().Add( Visual::Property::TYPE, Visual::IMAGE )
+ Property::Array().Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE )
.Add( ImageVisual::Property::URL, DEMO_IMAGE_DIR "Logo-for-demo.png" ) )
- .Add( Property::Map().Add( Visual::Property::TYPE, DevelVisual::TEXT )
+ .Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
.Add( TextVisual::Property::TEXT_COLOR, Color::WHITE )
.Add( TextVisual::Property::TEXT, "Custom coded style\nat hover point" )
.Add( TextVisual::Property::MULTI_LINE, true )
if( control )
{
control.SetProperty( Button::Property::LABEL,
- Property::Map().Add( Visual::Property::TYPE, DevelVisual::TEXT )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
.Add( TextVisual::Property::TEXT, label ) );
}
}
#include "shadow-button-impl.h"
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/type-registry-helper.h>
#include <dali/devel-api/scripting/enum-helper.h>
-#include <dali-toolkit/devel-api/align-enums.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <cstdio>
}
// Extract transform maps out of the visual definition and store them
- Property::Value* value = map->Find( DevelVisual::Property::TRANSFORM, "transform");
+ Property::Value* value = map->Find( Visual::Property::TRANSFORM, "transform");
if( value )
{
Property::Map* transformMap = value->GetMap();
// External includes
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
#include "shadow-button.h"
#include <cstdio>
#include <sstream>
#include "transition-application.h"
-/// Entry point for applications
int DALI_EXPORT_API main( int argc, char** argv )
{
const char* themeName = Demo::TransitionApplication::DEMO_THEME_ONE_PATH;
Property::Map mNativeImageTarget;
};
-void RunTest( Application& application )
-{
- VideoViewController test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
- RunTest( application );
-
+ VideoViewController test( application );
+ application.MainLoop();
return 0;
}
#include "beat-control-impl.h"
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/type-registry-helper.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
using namespace Dali; // Needed for macros
using namespace Dali::Toolkit;
Property::Map transformMap;
// Make the visual half the size of the control, but leave
// origin and anchor point at center, position is relative, but Zer0
- transformMap[ DevelVisual::Transform::Property::SIZE ] = mTransformSize;
- transformMap[ DevelVisual::Transform::Property::ORIGIN ] = mTransformOrigin;
- transformMap[ DevelVisual::Transform::Property::ANCHOR_POINT ] = mTransformAnchorPoint;
+ transformMap[ Visual::Transform::Property::SIZE ] = mTransformSize;
+ transformMap[ Visual::Transform::Property::ORIGIN ] = mTransformOrigin;
+ transformMap[ Visual::Transform::Property::ANCHOR_POINT ] = mTransformAnchorPoint;
mVisual.SetTransformAndSize( transformMap, size );
}
}
Property::Map* map = value.GetMap();
if( map )
{
- Property::Value* value = map->Find( DevelVisual::Property::TRANSFORM, "transform" );
+ Property::Value* value = map->Find( Visual::Property::TRANSFORM, "transform" );
if( value )
{
Property::Map* transformMap = value->GetMap();
// If there are more properties in the transform map, then we need to create a new visual
unsigned int sizeAndPositionPropertyCount = 0;
- Property::Value* sizeValue = transformMap->Find( DevelVisual::Transform::Property::SIZE, "size" );
+ Property::Value* sizeValue = transformMap->Find( Visual::Transform::Property::SIZE, "size" );
if( sizeValue )
{
sizeValue->Get( impl.mTransformSize );
++sizeAndPositionPropertyCount;
}
- Property::Value* originValue = transformMap->Find( DevelVisual::Transform::Property::ORIGIN, "origin" );
+ Property::Value* originValue = transformMap->Find( Visual::Transform::Property::ORIGIN, "origin" );
if( originValue )
{
int intValue = 0;
}
}
- Property::Value* anchorPointValue = transformMap->Find( DevelVisual::Transform::Property::ANCHOR_POINT, "anchorPoint" );
+ Property::Value* anchorPointValue = transformMap->Find( Visual::Transform::Property::ANCHOR_POINT, "anchorPoint" );
if( anchorPointValue )
{
int intValue = 0;
#include "beat-control.h"
#include <dali/public-api/animation/animation.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/devel-api/align-enums.h>
#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
+#include <dali-toolkit/public-api/align-enumerations.h>
namespace Demo
{
// External includes
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
#include "beat-control.h"
#include <cstdio>
#include <sstream>
mBeatControl = BeatControl::New();
mBeatControl.SetName("BeatControl");
mBeatControl.SetProperty( BeatControl::Property::BEAT_VISUAL, Property::Map()
- .Add( DevelVisual::Property::TRANSFORM, Property::Map()
- .Add( DevelVisual::Transform::Property::SIZE, Vector2(0.5f, 0.5f) ) ) );
+ .Add( Visual::Property::TRANSFORM, Property::Map()
+ .Add( Visual::Transform::Property::SIZE, Vector2(0.5f, 0.5f) ) ) );
mBeatControl.SetAnchorPoint( AnchorPoint::CENTER );
mBeatControl.SetParentOrigin( ParentOrigin::CENTER );
{
Property::Map map;
CreateVisualMap( i, map );
- map.Add( DevelVisual::Property::TRANSFORM, Property::Map()
- .Add( DevelVisual::Transform::Property::SIZE, Vector2(0.8f, 0.8f) ) );
+ map.Add( Visual::Property::TRANSFORM, Property::Map()
+ .Add( Visual::Transform::Property::SIZE, Vector2(0.8f, 0.8f) ) );
mVisualButtons[i] = BeatControl::New();
mVisualButtons[i].SetProperty( BeatControl::Property::BEAT_VISUAL, map );
mVisualButtons[i].SetName("VisualButton");
{
case 0:
{
- map[ Visual::Property::TYPE ] = Visual::COLOR;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::COLOR;
map[ ColorVisual::Property::MIX_COLOR ] = Color::YELLOW;
break;
}
case 1:
{
- map[ Visual::Property::TYPE ] = Visual::BORDER;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::BORDER;
map[ BorderVisual::Property::COLOR ] = Color::GREEN;
map[ BorderVisual::Property::SIZE ] = 5;
break;
}
case 2:
{
- map[ Visual::Property::TYPE ] = Visual::GRADIENT;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::GRADIENT;
Property::Array stopOffsets;
stopOffsets.PushBack( 0.0f );
}
case 3:
{
- map[ Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
map[ ImageVisual::Property::URL ] = DALI_LOGO_PATH;
break;
}
case 4:
{
- map[ Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
map[ ImageVisual::Property::URL ] = DEMO_IMAGE_DIR "preMultAlpha.png";
- map[ DevelVisual::Property::PREMULTIPLIED_ALPHA ] = true;
+ map[ Visual::Property::PREMULTIPLIED_ALPHA ] = true;
break;
}
case 5:
{
- map[ Visual::Property::TYPE ] = Visual::MESH;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::MESH;
map[ MeshVisual::Property::OBJECT_URL ] = DALI_ROBOT_MODEL_PATH;
map[ MeshVisual::Property::MATERIAL_URL ] = DALI_ROBOT_MATERIAL_PATH;
map[ MeshVisual::Property::TEXTURES_PATH ] = DEMO_IMAGE_DIR;
case 6:
{
- map[ Visual::Property::TYPE ] = Visual::PRIMITIVE;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::PRIMITIVE;
map[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::BEVELLED_CUBE;
map[ PrimitiveVisual::Property::BEVEL_PERCENTAGE ] = 0.3f;
case 7:
{
// NPatch
- map[ Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
map[ ImageVisual::Property::URL ] = DEMO_IMAGE_DIR "button-up-16.9.png";
break;
}
case 8:
{
// SVG
- map[ Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
map[ ImageVisual::Property::URL ] = DEMO_IMAGE_DIR "Kid1.svg";
break;
}
case 9:
{
- map[ Visual::Property::TYPE ] = DevelVisual::TEXT;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::TEXT;
map[ TextVisual::Property::TEXT ] = "Text";
map[ TextVisual::Property::TEXT_COLOR ] = Color::CYAN;
map[ TextVisual::Property::POINT_SIZE ] = 10;
default:
{
- map[ Visual::Property::TYPE ] = Visual::COLOR;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::COLOR;
map[ ColorVisual::Property::MIX_COLOR ] = Color::MAGENTA;
break;
}
int visual = actor.GetProperty<int>( mVisualIndex );
Property::Map map;
CreateVisualMap( visual, map );
- map.Add( DevelVisual::Property::TRANSFORM, Property::Map()
- .Add( DevelVisual::Transform::Property::SIZE, Vector2( 0.5f, 0.5f ) ) );
+ map.Add( Visual::Property::TRANSFORM, Property::Map()
+ .Add( Visual::Transform::Property::SIZE, Vector2( 0.5f, 0.5f ) ) );
mBeatControl.SetProperty( BeatControl::Property::BEAT_VISUAL, map );
}
return true;
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "transition-application.h"
-/// Entry point for applications
int DALI_EXPORT_API main( int argc, char** argv )
{
const char* themeName = Demo::TransitionApplication::DEMO_THEME_ONE_PATH;
Name: com.samsung.dali-demo
Summary: The OpenGLES Canvas Core Demo
-Version: 1.2.58
+Version: 1.2.60
Release: 1
Group: System/Libraries
License: Apache-2.0
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "অঁকোৱা-পকোৱা"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "Logging"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "পৰিবৰ্দ্ধক"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "মেশ অঙ্কুৰিত"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "মেশ অসংযোগ"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "3D অনুগামী"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Linien"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "Logging"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "Bildschirmlupe"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "Mesh Veränderung"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "Mesh Sortierung"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "3D-Modelle"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Mesh Line"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "Logging"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "Magnifier"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "Mesh Morph"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "Mesh Sorting"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "Mesh Visual"
msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL"
msgstr "Text Label"
+msgid "DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING"
+msgstr "Text Memory Profiling"
+
msgid "DALI_DEMO_STR_TITLE_TEXT_OVERLAP"
msgstr "Text Overlap"
msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG"
msgstr "Image View SVG"
+msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL"
+msgstr "Image View URL"
+
msgid "DALI_DEMO_STR_TITLE_ITEM_VIEW"
msgstr "Item View"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Mesh Line"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "Logging"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "Magnifier"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "Mesh Morph"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "Mesh Sorting"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "Mesh Visual"
msgid "DALI_DEMO_STR_TITLE_TEXT_LABEL"
msgstr "Text Label"
+msgid "DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING"
+msgstr "Text Memory Profiling"
+
msgid "DALI_DEMO_STR_TITLE_TEXT_OVERLAP"
msgstr "Text Overlap"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Lineas"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "Control de entrada"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "Lupa"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "Transformacion de geometrias"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "Ordenacion de geometrias"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "Gemeotria 3D"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Viivapolygoniverkko"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "Loggaus"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "Suurennuslasi"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "Polygoniverkon Muodonmuutos"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "Polygoniverkon Lajittelu"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "Polygoniverkkovisuaali"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "라인 메쉬"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "로깅"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "돋보기"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "메쉬 형태"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "메쉬 분류"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "메쉬 비주얼"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "വര"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "ലോഗിംഗ്"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "ഭൂതക്കണ്ണാടി"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "മോർഫ് mesh"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "തരംതിരിക്കലിനായി mesh"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "3D മോഡലിങ്"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "لکیریں"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "لاگنگ"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "مکبر"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "میش کی تبدیلی"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "میش کی چھنٹائی"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "3D میش"
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "线条"
-msgid "DALI_DEMO_STR_TITLE_LOGGING"
-msgstr "记录"
-
msgid "DALI_DEMO_STR_TITLE_MAGNIFIER"
msgstr "放大鏡"
msgid "DALI_DEMO_STR_TITLE_MESH_MORPH"
msgstr "网格变形"
-msgid "DALI_DEMO_STR_TITLE_MESH_SORTING"
-msgstr "网格排序"
-
msgid "DALI_DEMO_STR_TITLE_MESH_VISUAL"
msgstr "3D模型"
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING")
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA")
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG")
+#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL")
#define DALI_DEMO_STR_TITLE_ITEM_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ITEM_VIEW")
#define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS")
#define DALI_DEMO_STR_TITLE_LINE_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LINE_MESH")
-#define DALI_DEMO_STR_TITLE_LOGGING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LOGGING")
#define DALI_DEMO_STR_TITLE_MAGNIFIER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MAGNIFIER")
#define DALI_DEMO_STR_TITLE_MESH_MORPH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_MORPH")
-#define DALI_DEMO_STR_TITLE_MESH_SORTING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_SORTING")
#define DALI_DEMO_STR_TITLE_MESH_VISUAL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_VISUAL")
#define DALI_DEMO_STR_TITLE_MOTION_BLUR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_BLUR")
#define DALI_DEMO_STR_TITLE_MOTION_STRETCH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MOTION_STRETCH")
#define DALI_DEMO_STR_TITLE_TEXT_EDITOR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_EDITOR")
#define DALI_DEMO_STR_TITLE_TEXT_FIELD dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_FIELD")
#define DALI_DEMO_STR_TITLE_TEXT_LABEL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_LABEL")
+#define DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING")
#define DALI_DEMO_STR_TITLE_TEXT_OVERLAP dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_OVERLAP")
#define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE")
#define DALI_DEMO_STR_TITLE_TEXT_SCROLLING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXT_SCROLLING")
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING "Image View Alpha Blending"
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA "Image View Pixel Area"
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG "Image View SVG"
+#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL "Image View URL"
#define DALI_DEMO_STR_TITLE_ITEM_VIEW "Item View"
#define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS "Lights and shadows"
#define DALI_DEMO_STR_TITLE_LINE_MESH "Mesh Line"
-#define DALI_DEMO_STR_TITLE_LOGGING "Logging"
#define DALI_DEMO_STR_TITLE_MAGNIFIER "Magnifier"
#define DALI_DEMO_STR_TITLE_MESH_MORPH "Mesh Morph"
-#define DALI_DEMO_STR_TITLE_MESH_SORTING "Mesh Sorting"
#define DALI_DEMO_STR_TITLE_MESH_VISUAL "Mesh Visual"
#define DALI_DEMO_STR_TITLE_MOTION_BLUR "Motion Blur"
#define DALI_DEMO_STR_TITLE_MOTION_STRETCH "Motion Stretch"
#define DALI_DEMO_STR_TITLE_TEXT_EDITOR "Text Editor"
#define DALI_DEMO_STR_TITLE_TEXT_FIELD "Text Field"
#define DALI_DEMO_STR_TITLE_TEXT_LABEL "Text Label"
+#define DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING "Text Memory Profiling"
#define DALI_DEMO_STR_TITLE_TEXT_OVERLAP "Text Overlap"
#define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts"
#define DALI_DEMO_STR_TITLE_TEXT_SCROLLING "Text Scrolling"
Dali::Property::Map effect = Toolkit::CreateDistanceFieldEffect();
Property::Map imageMap;
imageMap.Add( ImageVisual::Property::URL, SHAPE_IMAGE_TABLE[ shapeType ] );
- imageMap.Add( Visual::Property::SHADER, effect );
+ imageMap.Add( Toolkit::Visual::Property::SHADER, effect );
dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] );