Commit 136309f9638b56b316cee85c3fb7a67988b180c3
[dali_1.1.10] Merge branch 'devel/master'
Change-Id: If2984f6a1a387ea654c7a427d6fc64dd353c11ad
Showing
11 changed files
with
61 additions
and
95 deletions
builder/dali-builder.cpp
| ... | ... | @@ -300,6 +300,10 @@ int main(int argc, char **argv) |
| 300 | 300 | |
| 301 | 301 | ExampleApp app(dali_app); |
| 302 | 302 | |
| 303 | + std::cout << "DALi Core: \t" << CORE_MAJOR_VERSION << "." << CORE_MINOR_VERSION << "." << CORE_MICRO_VERSION << " (" << CORE_BUILD_DATE << ")" << std::endl; | |
| 304 | + std::cout << "DALi Adaptor: \t" << ADAPTOR_MAJOR_VERSION << "." << ADAPTOR_MINOR_VERSION << "." << ADAPTOR_MICRO_VERSION << " (" << ADAPTOR_BUILD_DATE << ")\n"; | |
| 305 | + std::cout << "DALi Toolkit: \t" << Toolkit::TOOLKIT_MAJOR_VERSION << "." << Toolkit::TOOLKIT_MINOR_VERSION << "." << Toolkit::TOOLKIT_MICRO_VERSION << " (" << Toolkit::TOOLKIT_BUILD_DATE << ")\n"; | |
| 306 | + | |
| 303 | 307 | |
| 304 | 308 | if(argc > 1) |
| 305 | 309 | { | ... | ... |
demo/dali-table-view.cpp
| ... | ... | @@ -106,8 +106,8 @@ struct AnimateBubbleConstraint |
| 106 | 106 | { |
| 107 | 107 | public: |
| 108 | 108 | AnimateBubbleConstraint( const Vector3& initialPos, float scale ) |
| 109 | - : mInitialX( initialPos.x ), | |
| 110 | - mScale( scale ) | |
| 109 | + : mInitialX( initialPos.x ), | |
| 110 | + mScale( scale ) | |
| 111 | 111 | { |
| 112 | 112 | } |
| 113 | 113 | |
| ... | ... | @@ -130,7 +130,6 @@ public: |
| 130 | 130 | private: |
| 131 | 131 | float mInitialX; |
| 132 | 132 | float mScale; |
| 133 | - float mShapeSize; | |
| 134 | 133 | }; |
| 135 | 134 | |
| 136 | 135 | bool CompareByTitle( const Example& lhs, const Example& rhs ) | ... | ... |
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/item-view/item-view-example.cpp
| ... | ... | @@ -16,17 +16,10 @@ |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | #include <sstream> |
| 19 | -#include <iostream> | |
| 20 | -#include <vector> | |
| 21 | -#include <string> | |
| 22 | -#include <algorithm> | |
| 23 | -#include <cstdlib> // rand | |
| 24 | 19 | #include "shared/view.h" |
| 25 | 20 | |
| 26 | 21 | #include <dali/dali.h> |
| 27 | 22 | #include <dali-toolkit/dali-toolkit.h> |
| 28 | -#include <dali/devel-api/images/atlas.h> | |
| 29 | -#include <dali/devel-api/rendering/cull-face.h> | |
| 30 | 23 | |
| 31 | 24 | using namespace Dali; |
| 32 | 25 | using namespace Dali::Toolkit; |
| ... | ... | @@ -101,10 +94,6 @@ const char* IMAGE_PATHS[] = { |
| 101 | 94 | |
| 102 | 95 | const unsigned int NUM_IMAGES = sizeof(IMAGE_PATHS) / sizeof(char*); |
| 103 | 96 | |
| 104 | -const unsigned int IMAGE_WIDTH = 256; | |
| 105 | -const unsigned int IMAGE_HEIGHT = 256; | |
| 106 | -const unsigned int NUM_IMAGE_PER_ROW_IN_ATLAS = 8; | |
| 107 | - | |
| 108 | 97 | const char* BACKGROUND_IMAGE( "" ); |
| 109 | 98 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 110 | 99 | const char* EDIT_IMAGE( DALI_IMAGE_DIR "icon-edit.png" ); |
| ... | ... | @@ -128,14 +117,7 @@ const char* SPIRAL_LABEL("Spiral"); |
| 128 | 117 | const char* GRID_LABEL("Grid"); |
| 129 | 118 | const char* DEPTH_LABEL("Depth"); |
| 130 | 119 | |
| 131 | -const char* ITEM_BORDER_IMAGE_PATH( DALI_IMAGE_DIR "frame-128x128.png" ); | |
| 132 | -const Vector3 ITEM_BORDER_MARGIN_SIZE(24, 24, 0); | |
| 133 | - | |
| 134 | -// These values depend on the border image | |
| 135 | -const float ITEM_IMAGE_BORDER_LEFT = 13.0f; | |
| 136 | -const float ITEM_IMAGE_BORDER_RIGHT = 13.0f; | |
| 137 | -const float ITEM_IMAGE_BORDER_TOP = 13.0f; | |
| 138 | -const float ITEM_IMAGE_BORDER_BOTTOM = 13.0f; | |
| 120 | +const float ITEM_BORDER_SIZE = 2.0f; | |
| 139 | 121 | |
| 140 | 122 | const float DEPTH_LAYOUT_ITEM_SIZE_FACTOR_PORTRAIT = 1.0f; |
| 141 | 123 | const float DEPTH_LAYOUT_ITEM_SIZE_FACTOR_LANDSCAPE = 0.8f; |
| ... | ... | @@ -217,11 +199,9 @@ public: |
| 217 | 199 | |
| 218 | 200 | Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| 219 | 201 | |
| 220 | - // Create a border image shared by all the item actors | |
| 221 | - mBorderImage = ResourceImage::New(ITEM_BORDER_IMAGE_PATH); | |
| 222 | - | |
| 223 | 202 | // Creates a default view with a default tool bar. |
| 224 | 203 | // The view is added to the stage. |
| 204 | + | |
| 225 | 205 | Layer contents = DemoHelper::CreateView( mApplication, |
| 226 | 206 | mView, |
| 227 | 207 | mToolBar, |
| ... | ... | @@ -292,11 +272,7 @@ public: |
| 292 | 272 | mReplaceButton.SetVisible( false ); |
| 293 | 273 | stage.Add( mReplaceButton ); |
| 294 | 274 | |
| 295 | - // Store one 1x1 white image for multiple items to share for backgrounds: | |
| 296 | - mWhiteImage = BufferImage::WHITE(); | |
| 297 | - | |
| 298 | 275 | // Create the item view actor |
| 299 | - mImageAtlas = CreateImageAtlas(); | |
| 300 | 276 | mItemView = ItemView::New(*this); |
| 301 | 277 | mItemView.SetParentOrigin(ParentOrigin::CENTER); |
| 302 | 278 | mItemView.SetAnchorPoint(AnchorPoint::CENTER); |
| ... | ... | @@ -363,6 +339,22 @@ public: |
| 363 | 339 | */ |
| 364 | 340 | void SetLayout( int layoutId ) |
| 365 | 341 | { |
| 342 | + Stage stage = Dali::Stage::GetCurrent(); | |
| 343 | + switch( mCurrentLayout ) | |
| 344 | + { | |
| 345 | + case SPIRAL_LAYOUT: | |
| 346 | + case DEPTH_LAYOUT: | |
| 347 | + { | |
| 348 | + stage.GetRootLayer().SetBehavior(Layer::LAYER_3D); | |
| 349 | + break; | |
| 350 | + } | |
| 351 | + case GRID_LAYOUT: | |
| 352 | + { | |
| 353 | + stage.GetRootLayer().SetBehavior(Layer::LAYER_2D); | |
| 354 | + break; | |
| 355 | + } | |
| 356 | + } | |
| 357 | + | |
| 366 | 358 | // Set the new orientation to the layout |
| 367 | 359 | mItemView.GetLayout(layoutId)->SetOrientation(static_cast<ControlOrientation::Type>(mOrientation / 90)); |
| 368 | 360 | |
| ... | ... | @@ -857,61 +849,63 @@ public: // From ItemFactory |
| 857 | 849 | */ |
| 858 | 850 | virtual Actor NewItem(unsigned int itemId) |
| 859 | 851 | { |
| 860 | - // Create an image actor for this item | |
| 861 | - unsigned int imageId = itemId % NUM_IMAGES; | |
| 862 | - ImageActor::PixelArea pixelArea( (imageId%NUM_IMAGE_PER_ROW_IN_ATLAS)*IMAGE_WIDTH, | |
| 863 | - (imageId/NUM_IMAGE_PER_ROW_IN_ATLAS)*IMAGE_HEIGHT, | |
| 864 | - IMAGE_WIDTH, | |
| 865 | - IMAGE_HEIGHT ); | |
| 866 | - Actor actor = ImageActor::New(mImageAtlas, pixelArea); | |
| 852 | + // Create an image view for this item | |
| 853 | + ImageView actor = ImageView::New( IMAGE_PATHS[ itemId % NUM_IMAGES ] ); | |
| 854 | + actor.SetZ( 0.0f ); | |
| 867 | 855 | actor.SetPosition( INITIAL_OFFSCREEN_POSITION ); |
| 868 | 856 | |
| 869 | 857 | // Add a border image child actor |
| 870 | - ImageActor borderActor = ImageActor::New(mBorderImage); | |
| 858 | + ImageView borderActor = ImageView::New(); | |
| 871 | 859 | borderActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 872 | 860 | borderActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| 873 | - borderActor.SetPosition( 0.f, 0.f, 1.f ); | |
| 874 | - borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH ); | |
| 875 | - borderActor.SetNinePatchBorder( Vector4( ITEM_IMAGE_BORDER_LEFT, ITEM_IMAGE_BORDER_TOP, ITEM_IMAGE_BORDER_RIGHT, ITEM_IMAGE_BORDER_BOTTOM ) ); | |
| 876 | - borderActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); // darken with parent image-actor | |
| 877 | 861 | borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS ); |
| 878 | - borderActor.SetSizeModeFactor( ITEM_BORDER_MARGIN_SIZE ); | |
| 862 | + borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) ); | |
| 863 | + borderActor.SetColorMode( USE_PARENT_COLOR ); | |
| 864 | + | |
| 865 | + Property::Map borderProperty; | |
| 866 | + borderProperty.Insert( "rendererType", "borderRenderer" ); | |
| 867 | + borderProperty.Insert( "borderColor", Color::WHITE ); | |
| 868 | + borderProperty.Insert( "borderSize", ITEM_BORDER_SIZE ); | |
| 869 | + borderActor.SetProperty( ImageView::Property::IMAGE, borderProperty ); | |
| 870 | + | |
| 879 | 871 | actor.Add(borderActor); |
| 872 | + | |
| 880 | 873 | actor.SetKeyboardFocusable( true ); |
| 881 | 874 | |
| 882 | 875 | Vector3 spiralItemSize; |
| 883 | 876 | static_cast<ItemLayout&>(*mSpiralLayout).GetItemSize( 0u, Vector3( Stage::GetCurrent().GetSize() ), spiralItemSize ); |
| 884 | 877 | |
| 885 | 878 | // Add a checkbox child actor; invisible until edit-mode is enabled |
| 886 | - | |
| 887 | - ImageActor checkbox = ImageActor::New( mWhiteImage ); | |
| 879 | + ImageView checkbox = ImageView::New(); | |
| 888 | 880 | checkbox.SetName( "CheckBox" ); |
| 889 | - checkbox.SetColor( Vector4(0.0f,0.0f,0.0f,0.6f) ); | |
| 881 | + checkbox.SetColorMode( USE_PARENT_COLOR ); | |
| 890 | 882 | checkbox.SetParentOrigin( ParentOrigin::TOP_RIGHT ); |
| 891 | 883 | checkbox.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); |
| 892 | 884 | checkbox.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f ); |
| 893 | 885 | checkbox.SetPosition( -SELECTION_BORDER_WIDTH, SELECTION_BORDER_WIDTH ); |
| 894 | - checkbox.SetZ( 1.0f ); | |
| 895 | - SetCullFace(checkbox, Dali::CullBack); | |
| 896 | - checkbox.SetSortModifier( 150.0f ); | |
| 886 | + checkbox.SetZ( 0.1f ); | |
| 887 | + | |
| 888 | + Property::Map solidColorProperty; | |
| 889 | + solidColorProperty.Insert( "rendererType", "colorRenderer" ); | |
| 890 | + solidColorProperty.Insert( "blendColor", Vector4(0.f, 0.f, 0.f, 0.6f) ); | |
| 891 | + checkbox.SetProperty( ImageView::Property::IMAGE, solidColorProperty ); | |
| 892 | + | |
| 897 | 893 | if( MODE_REMOVE_MANY != mMode && |
| 898 | 894 | MODE_INSERT_MANY != mMode && |
| 899 | 895 | MODE_REPLACE_MANY != mMode ) |
| 900 | 896 | { |
| 901 | 897 | checkbox.SetVisible( false ); |
| 902 | 898 | } |
| 903 | - actor.Add( checkbox ); | |
| 899 | + borderActor.Add( checkbox ); | |
| 904 | 900 | |
| 905 | - ImageActor tick = ImageActor::New( ResourceImage::New(SELECTED_IMAGE) ); | |
| 906 | - tick.SetColorMode( USE_OWN_COLOR ); | |
| 901 | + ImageView tick = ImageView::New( SELECTED_IMAGE ); | |
| 907 | 902 | tick.SetName( "Tick" ); |
| 903 | + tick.SetColorMode( USE_PARENT_COLOR ); | |
| 908 | 904 | tick.SetParentOrigin( ParentOrigin::TOP_RIGHT ); |
| 909 | 905 | tick.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); |
| 910 | 906 | tick.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f ); |
| 911 | - tick.SetZ( 1.0f ); | |
| 912 | - tick.SetSortModifier( 150.0f ); | |
| 907 | + tick.SetZ( 0.2f ); | |
| 913 | 908 | tick.SetVisible( false ); |
| 914 | - SetCullFace(tick, Dali::CullBack); | |
| 915 | 909 | checkbox.Add( tick ); |
| 916 | 910 | |
| 917 | 911 | // Connect new items for various editing modes |
| ... | ... | @@ -926,23 +920,6 @@ public: // From ItemFactory |
| 926 | 920 | private: |
| 927 | 921 | |
| 928 | 922 | /** |
| 929 | - * Create an Atlas to tile the images inside. | |
| 930 | - */ | |
| 931 | - Atlas CreateImageAtlas() | |
| 932 | - { | |
| 933 | - const unsigned int atlas_width = IMAGE_WIDTH*NUM_IMAGE_PER_ROW_IN_ATLAS; | |
| 934 | - const unsigned int atlas_height = IMAGE_HEIGHT*ceil( static_cast<float>(NUM_IMAGES)/ static_cast<float>(NUM_IMAGE_PER_ROW_IN_ATLAS)); | |
| 935 | - Atlas atlas = Atlas::New(atlas_width, atlas_height, Pixel::RGB888); | |
| 936 | - | |
| 937 | - for( unsigned int i = 0; i < NUM_IMAGES; i++ ) | |
| 938 | - { | |
| 939 | - atlas.Upload( IMAGE_PATHS[i], (i%NUM_IMAGE_PER_ROW_IN_ATLAS)*IMAGE_WIDTH, (i/NUM_IMAGE_PER_ROW_IN_ATLAS)*IMAGE_HEIGHT ); | |
| 940 | - } | |
| 941 | - | |
| 942 | - return atlas; | |
| 943 | - } | |
| 944 | - | |
| 945 | - /** | |
| 946 | 923 | * Sets/Updates the title of the View |
| 947 | 924 | * @param[in] title The new title for the view. |
| 948 | 925 | */ |
| ... | ... | @@ -984,8 +961,6 @@ private: |
| 984 | 961 | TextLabel mTitleActor; ///< The Toolbar's Title. |
| 985 | 962 | |
| 986 | 963 | ItemView mItemView; |
| 987 | - Image mBorderImage; | |
| 988 | - Atlas mImageAtlas; | |
| 989 | 964 | unsigned int mCurrentLayout; |
| 990 | 965 | float mDurationSeconds; |
| 991 | 966 | |
| ... | ... | @@ -998,8 +973,6 @@ private: |
| 998 | 973 | Toolkit::PushButton mDeleteButton; |
| 999 | 974 | Toolkit::PushButton mInsertButton; |
| 1000 | 975 | Toolkit::PushButton mReplaceButton; |
| 1001 | - | |
| 1002 | - BufferImage mWhiteImage; | |
| 1003 | 976 | }; |
| 1004 | 977 | |
| 1005 | 978 | void RunTest(Application& app) | ... | ... |
examples/line-mesh/line-mesh-example.cpp
examples/mesh-morph/mesh-morph-example.cpp
examples/point-mesh/point-mesh-example.cpp
examples/scripting/scripting-example.cpp
| ... | ... | @@ -48,9 +48,7 @@ int main( int argc, char* argv[] ) |
| 48 | 48 | { |
| 49 | 49 | std::string arg( argv[i] ); |
| 50 | 50 | |
| 51 | - size_t idx = std::string::npos; | |
| 52 | - | |
| 53 | - idx = arg.find( ".json" ); | |
| 51 | + size_t idx = arg.find( ".json" ); | |
| 54 | 52 | if( idx != std::string::npos ) |
| 55 | 53 | { |
| 56 | 54 | jSONFileName = arg; | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| ... | ... | @@ -309,7 +309,6 @@ private: |
| 309 | 309 | */ |
| 310 | 310 | void ApplyEffectToScrollView() |
| 311 | 311 | { |
| 312 | - bool wrap(true); | |
| 313 | 312 | bool snap(true); |
| 314 | 313 | |
| 315 | 314 | Stage stage = Stage::GetCurrent(); |
| ... | ... | @@ -317,7 +316,7 @@ private: |
| 317 | 316 | |
| 318 | 317 | RulerPtr rulerX = CreateRuler(snap ? stageSize.width : 0.0f); |
| 319 | 318 | RulerPtr rulerY = new DefaultRuler; |
| 320 | - rulerX->SetDomain(RulerDomain(0.0f, stageSize.x * PAGE_COLUMNS, !wrap)); | |
| 319 | + rulerX->SetDomain(RulerDomain(0.0f, stageSize.x * PAGE_COLUMNS, false)); | |
| 321 | 320 | rulerY->Disable(); |
| 322 | 321 | |
| 323 | 322 | Dali::Path path = Dali::Path::New(); |
| ... | ... | @@ -396,14 +395,7 @@ private: |
| 396 | 395 | mScrollView.RemoveConstraintsFromChildren(); |
| 397 | 396 | |
| 398 | 397 | rulerX = CreateRuler(snap ? stageSize.width * 0.5f : 0.0f); |
| 399 | - if( wrap ) | |
| 400 | - { | |
| 401 | - rulerX->SetDomain(RulerDomain(0.0f, stageSize.x * 0.5f * PAGE_COLUMNS, !wrap)); | |
| 402 | - } | |
| 403 | - else | |
| 404 | - { | |
| 405 | - rulerX->SetDomain(RulerDomain(0.0f, stageSize.x*0.5f* (PAGE_COLUMNS+1), !wrap)); | |
| 406 | - } | |
| 398 | + rulerX->SetDomain( RulerDomain( 0.0f, stageSize.x * 0.5f * PAGE_COLUMNS, false ) ); | |
| 407 | 399 | |
| 408 | 400 | unsigned int currentPage = mScrollView.GetCurrentPage(); |
| 409 | 401 | if( mScrollViewEffect ) |
| ... | ... | @@ -411,7 +403,7 @@ private: |
| 411 | 403 | mScrollView.ApplyEffect(mScrollViewEffect); |
| 412 | 404 | } |
| 413 | 405 | |
| 414 | - mScrollView.SetWrapMode(wrap); | |
| 406 | + mScrollView.SetWrapMode( true ); | |
| 415 | 407 | mScrollView.SetRulerX( rulerX ); |
| 416 | 408 | mScrollView.SetRulerY( rulerY ); |
| 417 | 409 | ... | ... |
examples/textured-mesh/textured-mesh-example.cpp
| ... | ... | @@ -200,7 +200,7 @@ public: |
| 200 | 200 | animation.SetLooping(true); |
| 201 | 201 | animation.Play(); |
| 202 | 202 | |
| 203 | - stage.SetBackgroundColor(Vector4(0.0f, 0.2f, 0.2f, 1.0f));; | |
| 203 | + stage.SetBackgroundColor(Vector4(0.0f, 0.2f, 0.2f, 1.0f)); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | BufferImage CreateBufferImage() | ... | ... |