[dali_1.2.17] Merge branch 'devel/master' 81/101981/1
authoradam.b <adam.b@samsung.com>
Fri, 2 Dec 2016 14:08:06 +0000 (14:08 +0000)
committeradam.b <adam.b@samsung.com>
Fri, 2 Dec 2016 14:08:06 +0000 (14:08 +0000)
Change-Id: I6bce8c6579791f5b8a2d44e6209c635de874183b

89 files changed:
automated-tests/src/dali-internal/utc-Dali-Internal-GeometryBatcher.cpp
automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp
automated-tests/src/dali/CMakeLists.txt
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-CSharp-TypeRegistry.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-Constraint.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-Geometry.cpp
automated-tests/src/dali/utc-Dali-Handle.cpp
automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp
automated-tests/src/dali/utc-Dali-PropertyNotification.cpp
automated-tests/src/dali/utc-Dali-PropertyValue.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-Renderer.cpp
automated-tests/src/dali/utc-Dali-Scripting.cpp
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
build/scripts/generate-shader-strings.pl [deleted file]
build/tizen/dali-core/Makefile.am
dali/devel-api/actors/actor-devel.h [new file with mode: 0644]
dali/devel-api/actors/layer-devel.h [new file with mode: 0644]
dali/devel-api/file.list
dali/devel-api/object/csharp-type-info.h [new file with mode: 0644]
dali/devel-api/object/csharp-type-registry.cpp [new file with mode: 0644]
dali/devel-api/object/csharp-type-registry.h [new file with mode: 0644]
dali/devel-api/object/handle-devel.cpp [new file with mode: 0644]
dali/devel-api/object/handle-devel.h [new file with mode: 0644]
dali/devel-api/rendering/renderer-devel.h [new file with mode: 0644]
dali/devel-api/scripting/scripting.h
dali/devel-api/shader-effects/shader-effect.cpp [deleted file]
dali/devel-api/shader-effects/shader-effect.h [deleted file]
dali/internal/common/core-impl.cpp
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/key-frames-impl.cpp
dali/internal/event/animation/progress-value.h
dali/internal/event/common/object-impl-helper.h
dali/internal/event/common/object-impl.cpp
dali/internal/event/common/property-buffer-impl.cpp
dali/internal/event/common/property-input-impl.h
dali/internal/event/common/property-metadata.h
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-info-impl.h
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/common/type-registry-impl.h
dali/internal/event/effects/shader-declarations.h [deleted file]
dali/internal/event/effects/shader-effect-impl.cpp [deleted file]
dali/internal/event/effects/shader-effect-impl.h [deleted file]
dali/internal/event/effects/shader-factory.cpp
dali/internal/event/effects/shader-factory.h
dali/internal/event/events/long-press-gesture-processor.cpp
dali/internal/event/events/pan-gesture-processor.cpp
dali/internal/event/events/pinch-gesture-processor.cpp
dali/internal/event/events/tap-gesture-processor.cpp
dali/internal/event/rendering/renderer-impl.cpp
dali/internal/event/resources/archive.cpp [deleted file]
dali/internal/event/resources/archive.h [deleted file]
dali/internal/file.list
dali/internal/render/gl-resources/frame-buffer-texture.cpp
dali/internal/render/renderers/render-renderer.h
dali/internal/render/shader-source/README [deleted file]
dali/internal/render/shader-source/image.txt [deleted file]
dali/internal/render/shaders/custom-uniform.cpp [deleted file]
dali/internal/render/shaders/custom-uniform.h [deleted file]
dali/internal/render/shaders/program-cache.h
dali/internal/render/shaders/program-controller.h
dali/internal/render/shaders/scene-graph-shader.h
dali/internal/update/manager/render-instruction-processor.cpp
dali/internal/update/manager/render-task-processor.cpp
dali/internal/update/nodes/node.cpp
dali/internal/update/nodes/node.h
dali/public-api/actors/actor.h
dali/public-api/actors/custom-actor-impl.cpp
dali/public-api/actors/custom-actor-impl.h
dali/public-api/animation/animation.cpp
dali/public-api/animation/constraint.cpp
dali/public-api/common/dali-common.h
dali/public-api/dali-core-version.cpp
dali/public-api/object/handle.cpp
dali/public-api/object/handle.h
dali/public-api/rendering/renderer.h
dali/public-api/signals/base-signal.cpp
dali/public-api/signals/connection-tracker.cpp
packaging/dali.spec

index f2c679f..070bfdb 100644 (file)
@@ -1,4 +1,6 @@
 #include <dali/public-api/dali-core.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/update/manager/geometry-batcher.h>
 
@@ -170,7 +172,7 @@ Actor CreateActor( Actor& parent, Shader& shader, TextureSet& textureSet, Vector
   Renderer renderer = Renderer::New( geometry, shader );
 
   renderer.SetTextures( textureSet );
-  renderer.SetProperty( Dali::Renderer::Property::BATCHING_ENABLED, true );
+  renderer.SetProperty( Dali::DevelRenderer::Property::BATCHING_ENABLED, true );
 
   Actor actor = Actor::New();
   actor.SetPosition( position );
@@ -179,32 +181,16 @@ Actor CreateActor( Actor& parent, Shader& shader, TextureSet& textureSet, Vector
   return actor;
 }
 
-Actor CreateActor( Vector3 position )
-{
-  Actor actor = Actor::New();
-  actor.SetPosition( position );
-  return actor;
-}
-
-
 Actor CreateBatchParent( Vector3 pos )
 {
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::BATCH_PARENT, true );
+  actor.SetProperty( DevelActor::Property::BATCH_PARENT, true );
   actor.SetPosition( pos );
   Stage::GetCurrent().Add( actor );
   return actor;
 }
 
-void AddChildren( Actor parent, Actor* children, size_t size )
-{
-  for( size_t i = 0; i < size; ++i )
-  {
-    parent.Add( children[i] );
-  }
-}
-
-}
+} // namespace
 
 int UtcDaliGeometryBatcherBatchLevel0(void)
 {
index 034b341..7191eca 100644 (file)
@@ -97,26 +97,6 @@ public:
 static TestTicketObserver testTicketObserver;
 static TestTicketLifetimeObserver testTicketLifetimeObserver;
 
-
-Internal::ImagePtr LoadImage(TestApplication& application, char* name)
-{
-  Internal::ResourceImagePtr image = Internal::ResourceImage::New( name, Internal::ImageAttributes::DEFAULT_ATTRIBUTES );
-  application.SendNotification(); // Flush update messages
-  application.Render();           // Process resource request
-  Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
-  bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80,80,80,80 );
-  Integration::ResourcePointer resourcePtr(bitmap); // reference it
-  application.GetPlatform().SetResourceLoaded(req->GetId(), req->GetType()->id, resourcePtr);
-  application.Render();           // Process LoadComplete
-  application.SendNotification(); // Process event messages
-  application.GetPlatform().DiscardRequest(); // Ensure load request is discarded
-  req=NULL;
-  application.GetPlatform().ResetTrace();
-  return image;
-}
-
-
 Internal::ResourceTicketPtr CheckLoadBitmap(TestApplication& application, const char* name, int w, int h)
 {
   Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
index 0a55d1b..ce223b7 100644 (file)
@@ -88,6 +88,7 @@ SET(TC_SOURCES
         utc-Dali-TouchProcessing.cpp
         utc-Dali-TouchDataProcessing.cpp
         utc-Dali-TypeRegistry.cpp
+        utc-Dali-CSharp-TypeRegistry.cpp
         utc-Dali-Uint16Pair.cpp
         utc-Dali-Vector.cpp
         utc-Dali-Vector2.cpp
index a6eaa9c..e3f1061 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali/public-api/dali-core.h>
 #include <string>
 #include <cfloat>   // For FLT_MAX
+#include <dali/devel-api/actors/actor-devel.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali-test-suite-utils.h>
@@ -45,35 +46,6 @@ namespace
 bool gTouchCallBackCalled=false;
 bool gHoverCallBackCalled=false;
 
-/**
- * Simulates a Down Touch at 25.0, 25.0.
- * @param[in] app Test Application instance.
- */
-int SimulateTouchForSetOverlayHitTest(TestApplication& app)
-{
-  app.SendNotification();
-  app.Render(1);
-  app.SendNotification();
-  app.Render(1);
-
-  gTouchCallBackCalled = false;
-
-  // simulate a touch event
-  Dali::Integration::Point point;
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 25.0f, 25.0f ) );
-  Dali::Integration::TouchEvent event;
-  event.AddPoint( point );
-  app.ProcessEvent( event );
-
-  app.SendNotification();
-  app.Render(1);
-  app.SendNotification();
-  app.Render(1);
-  END_TEST;
-}
-
-
 static bool gTestConstraintCalled;
 
 struct TestConstraint
@@ -121,13 +93,6 @@ static bool TestCallback3(Actor actor, const HoverEvent& event)
   END_TEST;
 }
 
-static Vector3 gSetSize;
-static bool gSetSizeCallBackCalled;
-void SetSizeCallback( Actor actor, const Vector3& size )
-{
-  gSetSizeCallBackCalled = true;
-  gSetSize = size;
-}
 // validation stuff for onstage & offstage signals
 static std::vector< std::string > gActorNamesOnOffStage;
 static int gOnStageCallBackCalled;
@@ -2850,7 +2815,7 @@ const PropertyStringIndex PROPERTY_TABLE[] =
   { "minimumSize",              Actor::Property::MINIMUM_SIZE,             Property::VECTOR2     },
   { "maximumSize",              Actor::Property::MAXIMUM_SIZE,             Property::VECTOR2     },
   { "inheritPosition",          Actor::Property::INHERIT_POSITION,         Property::BOOLEAN     },
-  { "batchParent",              Actor::Property::BATCH_PARENT,             Property::BOOLEAN     },
+  { "batchParent",              DevelActor::Property::BATCH_PARENT,        Property::BOOLEAN     },
   { "clippingMode",             Actor::Property::CLIPPING_MODE,            Property::STRING      },
 };
 const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
index ea44054..860a01e 100644 (file)
@@ -10050,3 +10050,92 @@ int UtcDaliAnimationDuration(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimationAnimateByNonAnimateableTypeN(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  // Register an integer property
+  int startValue(1);
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
+
+  try
+  {
+    // Build the animation
+    Animation animation = Animation::New( 2.0f );
+    std::string relativeValue = "relative string";
+    animation.AnimateBy( Property(actor, index), relativeValue );
+    tet_result(TET_FAIL);
+  }
+  catch ( Dali::DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
+  }
+
+
+  END_TEST;
+}
+
+
+int UtcDaliAnimationAnimateToNonAnimateableTypeN(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  // Register an integer property
+  int startValue(1);
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
+
+  try
+  {
+    // Build the animation
+    Animation animation = Animation::New( 2.0f );
+    std::string relativeValue = "relative string";
+    animation.AnimateTo( Property(actor, index), relativeValue );
+
+    tet_result(TET_FAIL);
+  }
+  catch ( Dali::DaliException& e )
+  {
+   DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNonAnimateableTypeN(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  // Register an integer property
+  int startValue(1);
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
+
+  try
+  {
+    // Build the animation
+    KeyFrames keyFrames = KeyFrames::New();
+    keyFrames.Add( 0.0f, std::string("relative string1") );
+    keyFrames.Add( 1.0f, std::string("relative string2") );
+    // no need to really create the animation as keyframes do the check
+
+    tet_result(TET_FAIL);
+  }
+  catch ( Dali::DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Type not animateable", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali/utc-Dali-CSharp-TypeRegistry.cpp b/automated-tests/src/dali/utc-Dali-CSharp-TypeRegistry.cpp
new file mode 100644 (file)
index 0000000..bf97f9f
--- /dev/null
@@ -0,0 +1,294 @@
+/*
+ * 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.
+ *
+ */
+
+#include <iostream>
+#include <stdlib.h>
+#include <limits>
+#include <dali/public-api/dali-core.h>
+#include <dali-test-suite-utils.h>
+#include <dali/devel-api/object/csharp-type-info.h>
+#include <dali/devel-api/object/csharp-type-registry.h>
+#include <dali/internal/event/common/type-registry-impl.h>
+#include <dali/public-api/object/property.h>
+using namespace Dali;
+
+
+namespace
+{
+
+
+static bool CreateCustomNamedInitCalled = false;
+BaseHandle* CreateCustomNamedInit(void)
+{
+  CreateCustomNamedInitCalled = true;
+
+  BaseHandle* x = new BaseHandle();
+
+  return x;
+}
+
+// Property Registration
+bool setPropertyCalled = false;
+bool getPropertyCalled = false;
+int intPropertyValue = 0;
+void SetProperty( BaseObject* object, Property::Index* index, Property::Value* value )
+{
+
+  value->Get( intPropertyValue );
+
+  setPropertyCalled = true;
+}
+Property::Value* GetProperty( BaseObject* object, Property::Index* index )
+{
+  getPropertyCalled = true;
+  Property::Value* x = new Property::Value( 10 );
+  return x;
+}
+
+}
+
+int UtcDaliRegisterCSharpTypeP(void)
+{
+
+  TestApplication application;
+
+  CSharpTypeRegistry::RegisterType( "CSharpControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+
+  GetImplementation(Dali::TypeRegistry::Get()).CallInitFunctions();
+
+  DALI_TEST_EQUALS( CreateCustomNamedInitCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliRegisterCSharpTypeNoInitP(void)
+{
+
+  TestApplication application;
+  CreateCustomNamedInitCalled = false;
+
+  CSharpTypeRegistry::RegisterType( "CSharpControl", typeid( Dali::Actor), &CreateCustomNamedInit, false);
+
+  GetImplementation(Dali::TypeRegistry::Get()).CallInitFunctions();
+
+  DALI_TEST_EQUALS( CreateCustomNamedInitCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliRegisterCSharpTypeN(void)
+{
+  TestApplication application;
+
+  CSharpTypeRegistry::RegisterType( "CSharpControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+
+  // should cause an assert because we're registering same type twice
+  try
+  {
+    CSharpTypeRegistry::RegisterType( "CSharpControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Duplicate type name for Type Registation", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliRegisterCSharpTypeCreateP(void)
+{
+
+  TestApplication application;
+  CreateCustomNamedInitCalled = false;
+
+  CSharpTypeRegistry::RegisterType( "CSharpControl", typeid( Dali::Actor), &CreateCustomNamedInit, false);
+
+
+  TypeInfo info = Dali::TypeRegistry::Get().GetTypeInfo( "CSharpControl");
+
+
+
+  BaseHandle handle = info.CreateInstance();
+
+  DALI_TEST_EQUALS( CreateCustomNamedInitCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+
+int UtcDaliRegisterCSharpPropertyP(void)
+{
+  TestApplication application;
+
+  CSharpTypeRegistry::RegisterType( "DateControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+
+
+  bool registered = CSharpTypeRegistry::RegisterProperty( "DateControl",
+                    "year",
+                    10000 + 1,
+                    Property::INTEGER,
+                    SetProperty,
+                    GetProperty );
+
+  DALI_TEST_EQUALS( registered, true, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+
+int UtcDaliRegisterCSharpPropertyN(void)
+{
+  TestApplication application;
+
+  // register the same property twice
+  CSharpTypeRegistry::RegisterType( "DateControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+
+
+  bool registered = CSharpTypeRegistry::RegisterProperty( "DateControl",
+                    "year",
+                    10000 + 1,
+                    Property::INTEGER,
+                    SetProperty,
+                    GetProperty );
+
+  DALI_TEST_EQUALS( registered, true, TEST_LOCATION );
+
+
+  // should fail second time with an assert as the property is already registered
+  try
+  {
+    registered = CSharpTypeRegistry::RegisterProperty( "DateControl",
+                      "year",
+                      10000 + 1,
+                      Property::INTEGER,
+                      SetProperty,
+                      GetProperty );
+
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Property index already added to Type", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliRegisterCSharpPropertySetP(void)
+{
+  TestApplication application;
+
+   // register the same property twice
+   CSharpTypeRegistry::RegisterType( "DateControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+
+   Property::Index index(100001);
+
+   CSharpTypeRegistry::RegisterProperty( "DateControl",
+                     "year",
+                     index,
+                     Property::INTEGER,
+                     SetProperty,
+                     GetProperty );
+
+   TypeRegistry typeRegistry = TypeRegistry::Get();
+
+   TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "DateControl" );
+
+
+   // Check the property is writable in the type registry
+   Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+
+   Property::Value value(25);
+
+   typeInfoImpl.SetProperty( NULL, index, value );
+
+   DALI_TEST_EQUALS( 25, intPropertyValue , TEST_LOCATION );
+
+   Property::Value value2(50);
+
+   typeInfoImpl.SetProperty( NULL, "year", value2 );
+
+   DALI_TEST_EQUALS( 50, intPropertyValue , TEST_LOCATION );
+
+   DALI_TEST_EQUALS( setPropertyCalled, true, TEST_LOCATION );
+
+   END_TEST;
+}
+
+
+int UtcDaliRegisterCSharpPropertyGetP(void)
+{
+  TestApplication application;
+
+   // register the same property twice
+   CSharpTypeRegistry::RegisterType( "DateControl", typeid( Dali::Actor), &CreateCustomNamedInit, true );
+
+   Property::Index index(100001);
+
+   CSharpTypeRegistry::RegisterProperty( "DateControl",
+                     "year",
+                     index,
+                     Property::INTEGER,
+                     SetProperty,
+                     GetProperty );
+
+   TypeRegistry typeRegistry = TypeRegistry::Get();
+
+   TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "DateControl" );
+
+
+   // Check the property is writable in the type registry
+   Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+
+   Property::Value value(1);
+
+   value = typeInfoImpl.GetProperty( NULL, index );
+
+   int propValue;
+   value.Get( propValue );
+
+   DALI_TEST_EQUALS( getPropertyCalled, true, TEST_LOCATION );
+   DALI_TEST_EQUALS( propValue, 10, TEST_LOCATION );
+
+   value = typeInfoImpl.GetProperty( NULL, "year");
+   value.Get( propValue );
+
+   DALI_TEST_EQUALS( propValue, 10, TEST_LOCATION );
+
+   END_TEST;
+}
+
+int UtcDaliRegisterCSharpPropertyNotRegisteredN(void)
+{
+  TestApplication application;
+
+  // control not registered, should fail
+  bool registered = CSharpTypeRegistry::RegisterProperty( "DateControl",
+                    "year",
+                    10000 + 1,
+                    Property::INTEGER,
+                    SetProperty,
+                    GetProperty );
+
+  DALI_TEST_EQUALS( registered, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
index 410a14a..814c453 100644 (file)
@@ -160,6 +160,41 @@ int UtcDaliConstraintNewFunctionN(void)
 
   END_TEST;
 }
+
+// helper for next test
+void StringConstraintFunction( std::string& /* current */, const PropertyInputContainer& /* inputs */ )
+{
+}
+
+int UtcDaliConstraintNewFunctionNonConstrainableTypeN(void)
+{
+  // Ensure that we can create a constraint using a C function and that it is called.
+
+  TestApplication application;
+  UtcDaliConstraintNewFunction::gConstraintFunctionCalled = false;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  try
+  {
+    // Add a constraint
+    Constraint constraint = Constraint::New< std::string >( actor, Actor::Property::COLOR_MODE, &StringConstraintFunction );
+    DALI_TEST_CHECK( constraint );
+    constraint.Apply();
+    tet_result(TET_FAIL);
+  }
+  catch ( Dali::DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Property not constrainable", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////////
index 347ef03..c32c8e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -823,7 +823,7 @@ int UtcDaliCustomActorImplDestructor(void)
 {
   TestApplication application;
   CustomActorImpl* actor = new Impl::TestCustomActor();
-  delete actor;
+  CustomActor customActor( *actor ); // Will automatically unref at the end of this function
 
   DALI_TEST_CHECK( true );
   END_TEST;
@@ -1747,12 +1747,12 @@ int UtcDaliCustomActorImplOnPropertySet(void)
 {
   TestApplication application;
   CustomActorImpl* impl = new Impl::SimpleTestCustomActor();
+  CustomActor customActor( *impl ); // Will automatically unref at the end of this function
 
   impl->OnPropertySet( 0, 0 );
 
   DALI_TEST_CHECK( true );
 
-  delete impl;
   END_TEST;
 }
 
index 2edfd8e..6fb9b80 100644 (file)
@@ -35,11 +35,6 @@ void geometry_test_cleanup(void)
 namespace
 {
 
-void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs )
-{
-  current.b = 0.0f;
-}
-
 struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
 
 PropertyBuffer CreateVertexBuffer( const std::string& aPosition, const std::string& aTexCoord )
index 35e2784..f06d9ab 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include "dali-test-suite-utils/dali-test-suite-utils.h"
 #include <mesh-builder.h>
 
@@ -208,17 +209,17 @@ int UtcDaliHandleGetPropertyIndex02(void)
   const float withFlake(99.f);
 
   Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
-  Property::Index index2 = actor.RegisterProperty( key1, "sideColor", testColor);
+  Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
   Property::Index index3 = actor.RegisterProperty( "MyPropertyTwo", Vector3::ONE );
-  Property::Index index4 = actor.RegisterProperty( key2, "iceCream", withFlake );
+  Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
   Property::Index index5 = actor.RegisterProperty( "MyPropertyThree", Vector3::ONE );
 
   application.SendNotification();
   application.Render();
 
   // Test that we can get the property index from the integer key
-  Property::Index testIndex1 = actor.GetPropertyIndex( key1 );
-  Property::Index testIndex2 = actor.GetPropertyIndex( key2 );
+  Property::Index testIndex1 = DevelHandle::GetPropertyIndex( actor, key1 );
+  Property::Index testIndex2 = DevelHandle::GetPropertyIndex( actor, key2 );
 
   DALI_TEST_EQUALS( index2, testIndex1, TEST_LOCATION );
   DALI_TEST_EQUALS( index4, testIndex2, TEST_LOCATION );
@@ -248,15 +249,15 @@ int UtcDaliHandleGetPropertyIndex03(void)
   std::string myName("croydon");
   Property::Index intKey = CORE_PROPERTY_MAX_INDEX+1;
   Property::Value value( Color::GREEN );
-  Property::Index myIndex = actor.RegisterProperty( intKey, myName, value );
+  Property::Index myIndex = DevelHandle::RegisterProperty( actor, intKey, myName, value );
 
-  DALI_TEST_EQUALS( myIndex, actor.GetPropertyIndex( intKey ), TEST_LOCATION );
+  DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, intKey ), TEST_LOCATION );
 
   Property::Key key1(myName);
   Property::Key key2(intKey);
 
-  DALI_TEST_EQUALS( myIndex, actor.GetPropertyIndex( key1 ), TEST_LOCATION );
-  DALI_TEST_EQUALS( myIndex, actor.GetPropertyIndex( key2 ), TEST_LOCATION );
+  DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, key1 ), TEST_LOCATION );
+  DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, key2 ), TEST_LOCATION );
   END_TEST;
 }
 
@@ -490,24 +491,17 @@ int UtcDaliHandleGetPropertyType(void)
   END_TEST;
 }
 
-int UtcDaliHandleNonAnimtableProperties(void)
+int UtcDaliHandleNonAnimatableProperties(void)
 {
   tet_infoline("Test Non Animatable Properties");
   TestApplication application;
 
   Actor actor = Actor::New();
 
-  Property::Index nonAnimStringIndex = actor.RegisterProperty( "manFromDelmonte",   std::string("no"), Property::READ_WRITE);
+  Property::Index nonAnimStringIndex = actor.RegisterProperty( "manFromDelmonte", std::string("no"), Property::READ_WRITE);
 
   //// modify writable?
-  try
-  {
-    actor.SetProperty( nonAnimStringIndex, Property::Value("yes") );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_CHECK(!"exception");
-  }
+  actor.SetProperty( nonAnimStringIndex, Property::Value("yes") );
 
   DALI_TEST_CHECK( "yes"  == actor.GetProperty( nonAnimStringIndex ).Get<std::string>() );
 
@@ -517,17 +511,8 @@ int UtcDaliHandleNonAnimtableProperties(void)
   DALI_TEST_CHECK(!actor.IsPropertyAnimatable(readonly));
   DALI_TEST_CHECK(!actor.IsPropertyWritable(readonly));
 
-  bool exception = false;
-  try
-  {
-    actor.SetProperty( readonly, Property::Value(1.f) );
-  }
-  catch (Dali::DaliException& e)
-  {
-    exception = true;
-  }
-
-  DALI_TEST_CHECK(!exception);// trying to set a read-only property is a no-op
+  actor.SetProperty( readonly, Property::Value(1.f) );
+  // trying to set a read-only property is a no-op
 
   DALI_TEST_EQUALS( 0.f, actor.GetProperty( readonly ).Get<float>(), TEST_LOCATION );
 
@@ -537,38 +522,21 @@ int UtcDaliHandleNonAnimtableProperties(void)
   DALI_TEST_CHECK(actor.IsPropertyAnimatable(write_anim));
   DALI_TEST_CHECK(actor.IsPropertyWritable(write_anim));
 
-  exception = false;
-  try
-  {
-    actor.SetProperty( write_anim, Property::Value(1.f) );
-  }
-  catch (Dali::DaliException& e)
-  {
-    exception = true;
-  }
-
-  DALI_TEST_CHECK(!exception);
+  actor.SetProperty( write_anim, Property::Value(1.f) );
 
-  //// animate a non animatable property is a noop?
+  //// animate a non animatable property throws
   float durationSeconds(2.0f);
   Animation animation = Animation::New(durationSeconds);
   bool relativeValue(true);
-
-  exception = false;
-
   try
   {
     animation.AnimateBy(Property(actor, nonAnimStringIndex), relativeValue, AlphaFunction::EASE_IN);
-    animation.Play();
-    application.SendNotification();
-    application.Render(static_cast<unsigned int>(durationSeconds*0100.0f)/* some progress */);
   }
-  catch (Dali::DaliException& e)
+  catch ( Dali::DaliException& e )
   {
-    exception = true;
+    DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
   }
 
-  DALI_TEST_CHECK(!exception);
   DALI_TEST_EQUALS( "yes", actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
 
   END_TEST;
@@ -726,8 +694,8 @@ int UtcDaliHandleRegisterProperty02(void)
   const float withFlake(99.f);
 
   Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
-  Property::Index index2 = actor.RegisterProperty( key1, "sideColor", testColor);
-  Property::Index index3 = actor.RegisterProperty( key2, "iceCream", withFlake );
+  Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
+  Property::Index index3 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
 
   application.SendNotification();
   application.Render();
@@ -828,9 +796,9 @@ int UtcDaliHandleGetPropertyIndices(void)
   Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
 
   actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
-  actor.RegisterProperty( key1, "sideColor", testColor);
+  DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
   actor.RegisterProperty( "MyPropertyTwo", 1234 );
-  Property::Index index4 = actor.RegisterProperty( key2, "iceCream", withFlake );
+  Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
   actor.RegisterProperty( "MyPropertyThree", Vector2(.2f,.7f) );
 
   actor.GetPropertyIndices( indices );
index 66d85c7..2f2761f 100644 (file)
@@ -972,7 +972,7 @@ int UtcDaliLongPressGestureEmitIncorrectStateClear(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1005,7 +1005,7 @@ int UtcDaliLongPressGestureEmitIncorrectStateContinuing(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
index d305917..276c833 100644 (file)
@@ -1416,7 +1416,7 @@ int UtcDaliPanGestureEmitIncorrectState(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
index 6550e00..7d9358d 100644 (file)
@@ -977,7 +977,7 @@ int UtcDaliPinchGestureEmitIncorrectStateClear(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1010,7 +1010,7 @@ int UtcDaliPinchGestureEmitIncorrectStatePossible(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
index c790655..4da91dc 100644 (file)
@@ -22,14 +22,6 @@ using namespace Dali;
 
 #include <mesh-builder.h>
 
-namespace
-{
-void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs )
-{
-  current.b = 0.0f;
-}
-}
-
 void propertyBuffer_test_startup(void)
 {
   test_return_value = TET_UNDEF;
@@ -230,9 +222,29 @@ int UtcDaliPropertyBufferSetData02(void)
     if ( bufferSubDataCalls.size() )
     {
       DALI_TEST_EQUALS( bufferSubDataCalls[0], sizeof(texturedQuadVertexData), TEST_LOCATION );
-
     }
   }
 
   END_TEST;
 }
+
+int UtcDaliPropertyBufferInvalidTypeN(void)
+{
+  TestApplication application;
+
+  Property::Map texturedQuadVertexFormat;
+  texturedQuadVertexFormat["aPosition"] = Property::MAP;
+  texturedQuadVertexFormat["aVertexCoord"] = Property::STRING;
+
+  try
+  {
+    PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
+    tet_result(TET_FAIL);
+  }
+  catch ( Dali::DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Property::Type not supported in PropertyBuffer", TEST_LOCATION );
+  }
+  END_TEST;
+}
+
index 17ae6cc..23f575d 100644 (file)
@@ -259,7 +259,25 @@ int UtcDaliAddPropertyNotificationTypeProperty(void)
   }
   catch ( DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false && \"Property notification added to event side only property", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Property notification added to event side only property", TEST_LOCATION );
+  }
+  END_TEST;
+}
+
+int UtcDaliAddPropertyNotificationEventSidePropertyN(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  // Currently, Type registry properties cannot be animated
+  try
+  {
+    actor.AddPropertyNotification( PROPERTY_REGISTRATION_MAX_INDEX - 1, GreaterThanCondition( 100.0f ) );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Property notification added to event side only property", TEST_LOCATION );
   }
   END_TEST;
 }
index ea4ec5d..99abb22 100644 (file)
@@ -26,84 +26,6 @@ using namespace Dali;
 namespace
 {
 
-void CheckTypeName(const Property::Type& type)
-{
-  switch(type)
-  {
-    case Property::NONE:
-    {
-      DALI_TEST_CHECK( "NONE" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::BOOLEAN:
-    {
-      DALI_TEST_CHECK( "BOOLEAN" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::FLOAT:
-    {
-      DALI_TEST_CHECK( "FLOAT" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::INTEGER:
-    {
-      DALI_TEST_CHECK( "INTEGER" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::VECTOR2:
-    {
-      DALI_TEST_CHECK( "VECTOR2" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::VECTOR3:
-    {
-      DALI_TEST_CHECK( "VECTOR3" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::VECTOR4:
-    {
-      DALI_TEST_CHECK( "VECTOR4" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::MATRIX3:
-    {
-      DALI_TEST_CHECK( "MATRIX3" == std::string(PropertyTypes::GetName( type  ) ) );
-      break;
-    }
-    case Property::MATRIX:
-    {
-      DALI_TEST_CHECK( "MATRIX" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::RECTANGLE:
-    {
-      DALI_TEST_CHECK( "RECTANGLE" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::ROTATION:
-    {
-      DALI_TEST_CHECK( "ROTATION" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::STRING:
-    {
-      DALI_TEST_CHECK( "STRING" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::ARRAY:
-    {
-      DALI_TEST_CHECK( "ARRAY" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-    case Property::MAP:
-    {
-      DALI_TEST_CHECK( "MAP" == std::string(PropertyTypes::GetName( type ) ) );
-      break;
-    }
-  } // switch(type)
-
-} // CheckTypeName
-
 template <typename T>
 struct CheckCopyCtorP
 {
index 4c592a5..6c0b851 100644 (file)
@@ -212,15 +212,6 @@ void FailImageLoad(TestApplication& application, Integration::ResourceId resourc
   application.GetPlatform().SetResourceLoadFailed(resourceId, Integration::FailureUnknown);
 }
 
-void ReloadImage(TestApplication& application, ResourceImage image)
-{
-  application.GetPlatform().ClearReadyResources();
-  application.GetPlatform().DiscardRequest();
-  application.GetPlatform().ResetTrace();
-  application.GetPlatform().SetClosestImageSize(Vector2(80.0f, 80.0f)); // Ensure reload is called.
-  image.Reload();
-}
-
 RenderTask CreateRenderTask(TestApplication& application,
                             CameraActor offscreenCamera,
                             Actor rootActor,       // Reset default render task to point at this actor
@@ -2392,81 +2383,6 @@ int UtcDaliRenderTaskOnce05(void)
   END_TEST;
 }
 
-#if 0
-//int UtcDaliRenderTaskOnce06(void)
-{
-  TestApplication application;
-
-  tet_infoline("Testing RenderTask Render Once GlSync\n"
-               "During RenderOnce, make ready resources unready before sending first finished signal\n"
-               "PRE: Everything ready.\n"
-               "POST: Finished signal sent only once");
-
-  // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-  TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
-  TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
-  drawTrace.Enable(true);
-
-  Actor rootActor = Actor::New();
-  Stage::GetCurrent().Add( rootActor );
-
-  CameraActor offscreenCameraActor = CameraActor::New();
-  Stage::GetCurrent().Add( offscreenCameraActor );
-  Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg");
-  Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
-  Integration::ResourceId imageRequestId = imageRequest->GetId();
-  Integration::ResourceTypeId imageType  = imageRequest->GetType()->id;
-  CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
-  application.Render();
-
-  Stage::GetCurrent().Add(secondRootActor);
-  application.GetPlatform().ClearReadyResources();
-
-  RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
-  bool finished = false;
-  RenderTaskFinished renderTaskFinished( finished );
-  newTask.FinishedSignal().Connect( &application, renderTaskFinished );
-  application.SendNotification();
-
-  // START PROCESS/RENDER                    Input,    Expected  Input,    Expected
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, true, __LINE__ ) );
-
-  // CHANGE TO RENDER ONCE, RESOURCES BECOME NOT READY
-  newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
-
-  // Doesn't work...
-  ReloadImage(application, secondRootActor.GetImage());
-  application.SendNotification(); //         Input,    Expected  Input,    Expected
-
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,    finished, false, true, __LINE__ ) );
-  DALI_TEST_EQUALS( secondRootActor.GetImage().GetLoadingState(), Dali::ResourceLoading, TEST_LOCATION);
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,    finished, false, true, __LINE__ ) );
-
-  // FINISH RESOURCE LOADING
-  CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, true, __LINE__ ) );
-  application.GetPlatform().ClearReadyResources();
-  Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
-  DALI_TEST_CHECK( lastSyncObj != NULL );
-
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  sync.SetObjectSynced( lastSyncObj, true );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__  ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, true, __LINE__  ) );
-
-  // Finished rendering - expect no more renders, no more signals:
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  END_TEST;
-}
-#endif
-
 int UtcDaliRenderTaskOnce07(void)
 {
   TestApplication application;
@@ -2998,69 +2914,6 @@ int UtcDaliRenderTaskOnceNoSync05(void)
   END_TEST;
 }
 
-#if 0
-//int UtcDaliRenderTaskOnceNoSync06(void)
-{
-  TestApplication application;
-
-  tet_infoline("Testing RenderTask Render Once\n"
-               "During RenderOnce, make ready resources unready before sending first finished signal\n"
-               "PRE: Everything ready.\n"
-               "POST: Finished signal sent only once");
-
-  // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-  TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
-  drawTrace.Enable(true);
-
-  Actor rootActor = Actor::New();
-  Stage::GetCurrent().Add( rootActor );
-
-  CameraActor offscreenCameraActor = CameraActor::New();
-  Stage::GetCurrent().Add( offscreenCameraActor );
-  Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg");
-  Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
-  Integration::ResourceId imageRequestId = imageRequest->GetId();
-  Integration::ResourceTypeId imageType  = imageRequest->GetType()->id;
-  CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
-  application.Render();
-  application.GetPlatform().ClearReadyResources();
-
-  Stage::GetCurrent().Add(secondRootActor);
-
-  RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, false);
-  bool finished = false;
-  RenderTaskFinished renderTaskFinished( finished );
-  newTask.FinishedSignal().Connect( &application, renderTaskFinished );
-  application.SendNotification();
-
-  // START PROCESS/RENDER                    Input,    Expected  Input,    Expected
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, false, __LINE__ ) );
-
-  // CHANGE TO RENDER ONCE, RESOURCES BECOME NOT READY
-  newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
-
-  // Doesn't work...
-  ReloadImage(application, secondRootActor.GetImage());
-  application.SendNotification(); //         Input,    Expected  Input,    Expected
-
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,    finished, false, true, __LINE__ ) );
-  DALI_TEST_EQUALS( secondRootActor.GetImage().GetLoadingState(), Dali::ResourceLoading, TEST_LOCATION);
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,    finished, false, true, __LINE__ ) );
-
-  // FINISH RESOURCE LOADING
-  CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, true, true, __LINE__ ) );
-  application.GetPlatform().ClearReadyResources();
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__  ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__ ) );
-  END_TEST;
-}
-#endif
-
 int UtcDaliRenderTaskOnceNoSync07(void)
 {
   TestApplication application;
index 8d1bc31..0a89471 100644 (file)
@@ -16,6 +16,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
+
 #include <dali/public-api/dali-core.h>
 #include <dali/devel-api/images/texture-set-image.h>
 #include <cstdio>
@@ -1645,6 +1647,157 @@ int UtcDaliRendererRenderOrder2DLayerMultipleRenderers(void)
   END_TEST;
 }
 
+int UtcDaliRendererRenderOrder2DLayerDepthIndex(void)
+{
+  TestApplication application;
+  tet_infoline("Test the rendering order in a 2D layer is correct using multiple renderers per actor");
+
+  /*
+   * Creates the following hierarchy:
+   *
+   *                            Layer
+   *                           /    \
+   *                         /        \
+   *                       /            \
+   *                     /                \
+   *                   /                    \
+   *             actor0 (SIBLING_ORDER:1)     actor1 (SIBLING_ORDER:0)
+   *            /   |   \                    /   |   \
+   *          /     |     \                /     |     \
+   *        /       |       \            /       |       \
+   * renderer0 renderer1  actor2     renderer2 renderer3 renderer4
+   *                        |
+   *                        |
+   *                   renderer5
+   *
+   *  actor0 has sibling order 1
+   *  actor1 has sibling order 0
+   *  actor2 has sibling order 0
+   *
+   *  renderer0 has depth index 2
+   *  renderer1 has depth index 0
+   *
+   *  renderer2 has depth index 0
+   *  renderer3 has depth index 1
+   *  renderer4 has depth index 2
+   *
+   *  renderer5 has depth index -1
+   *
+   *  Expected rendering order: renderer2 - renderer3 - renderer4 - renderer1 - renderer0 - renderer5
+   */
+
+  Shader shader = Shader::New("VertexSource", "FragmentSource");
+  Geometry geometry = CreateQuadGeometry();
+
+  Actor actor0 = Actor::New();
+  actor0.SetAnchorPoint(AnchorPoint::CENTER);
+  actor0.SetParentOrigin(AnchorPoint::CENTER);
+  actor0.SetPosition(0.0f,0.0f);
+  actor0.SetSize(1, 1);
+  actor0.SetProperty( Dali::DevelActor::Property::SIBLING_ORDER, 1 );
+  DALI_TEST_EQUALS( actor0.GetProperty<int>( Dali::DevelActor::Property::SIBLING_ORDER), 1, TEST_LOCATION );
+  Stage::GetCurrent().Add(actor0);
+
+  Actor actor1 = Actor::New();
+  actor1.SetAnchorPoint(AnchorPoint::CENTER);
+  actor1.SetParentOrigin(AnchorPoint::CENTER);
+  actor1.SetPosition(0.0f,0.0f);
+  actor1.SetSize(1, 1);
+  DALI_TEST_EQUALS( actor1.GetProperty<int>( Dali::DevelActor::Property::SIBLING_ORDER), 0, TEST_LOCATION );
+  Stage::GetCurrent().Add(actor1);
+
+  Actor actor2 = Actor::New();
+  actor2.SetAnchorPoint(AnchorPoint::CENTER);
+  actor2.SetParentOrigin(AnchorPoint::CENTER);
+  actor2.SetPosition(0.0f,0.0f);
+  actor2.SetSize(1, 1);
+  DALI_TEST_EQUALS( actor1.GetProperty<int>( Dali::DevelActor::Property::SIBLING_ORDER), 0, TEST_LOCATION );
+  actor0.Add(actor2);
+
+  //Renderer0
+  Image image0 = BufferImage::New( 64, 64, Pixel::RGB888 );
+  TextureSet textureSet0 = CreateTextureSet( image0 );
+  Renderer renderer0 = Renderer::New( geometry, shader );
+  renderer0.SetTextures( textureSet0 );
+  renderer0.SetProperty( Renderer::Property::DEPTH_INDEX, 2 );
+  actor0.AddRenderer(renderer0);
+  application.SendNotification();
+  application.Render(0);
+
+  //Renderer1
+  Image image1= BufferImage::New( 64, 64, Pixel::RGB888 );
+  TextureSet textureSet1 = CreateTextureSet( image1 );
+  Renderer renderer1 = Renderer::New( geometry, shader );
+  renderer1.SetTextures( textureSet1 );
+  renderer1.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
+  actor0.AddRenderer(renderer1);
+  application.SendNotification();
+  application.Render(0);
+
+  //Renderer2
+  Image image2= BufferImage::New( 64, 64, Pixel::RGB888 );
+  TextureSet textureSet2 = CreateTextureSet( image2 );
+  Renderer renderer2 = Renderer::New( geometry, shader );
+  renderer2.SetTextures( textureSet2 );
+  renderer2.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
+  actor1.AddRenderer(renderer2);
+  application.SendNotification();
+  application.Render(0);
+
+  //Renderer3
+  Image image3 = BufferImage::New( 64, 64, Pixel::RGB888 );
+  TextureSet textureSet3 = CreateTextureSet( image3 );
+  Renderer renderer3 = Renderer::New( geometry, shader );
+  renderer3.SetTextures( textureSet3 );
+  renderer3.SetProperty( Renderer::Property::DEPTH_INDEX, 1 );
+  actor1.AddRenderer(renderer3);
+  application.SendNotification();
+  application.Render(0);
+
+  //Renderer4
+  Image image4= BufferImage::New( 64, 64, Pixel::RGB888 );
+  TextureSet textureSet4 = CreateTextureSet( image4 );
+  Renderer renderer4 = Renderer::New( geometry, shader );
+  renderer4.SetTextures( textureSet4 );
+  renderer4.SetProperty( Renderer::Property::DEPTH_INDEX, 2 );
+  actor1.AddRenderer(renderer4);
+  application.SendNotification();
+  application.Render(0);
+
+  //Renderer5
+  Image image5= BufferImage::New( 64, 64, Pixel::RGB888 );
+  TextureSet textureSet5 = CreateTextureSet( image5 );
+  Renderer renderer5 = Renderer::New( geometry, shader );
+  renderer5.SetTextures( textureSet5 );
+  renderer5.SetProperty( Renderer::Property::DEPTH_INDEX, -1 );
+  actor2.AddRenderer(renderer5);
+  application.SendNotification();
+  application.Render(0);
+
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  gl.EnableTextureCallTrace(true);
+  application.SendNotification();
+  application.Render(0);
+
+  int textureBindIndex[6];
+  for( unsigned int i(0); i<6; ++i )
+  {
+    std::stringstream params;
+    params << GL_TEXTURE_2D<<", "<<i+1;
+    textureBindIndex[i] = gl.GetTextureTrace().FindIndexFromMethodAndParams("BindTexture", params.str() );
+  }
+
+  DALI_TEST_EQUALS( textureBindIndex[2], 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureBindIndex[3], 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureBindIndex[4], 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureBindIndex[1], 3, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureBindIndex[0], 4, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureBindIndex[5], 5, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliRendererRenderOrder2DLayerOverlay(void)
 {
   TestApplication application;
index 756176a..2bdfdbc 100644 (file)
@@ -82,14 +82,7 @@ void TestEnumStrings(
   }
 }
 
-/// Helper method to create ResourceImage using property
-ResourceImage NewResourceImage( const Property::Value& map )
-{
-  ResourceImage image = ResourceImage::DownCast( NewImage( map ) );
-  return image;
-}
-
-/// Helper method to create ResourceImage using property
+/// Helper method to create BufferImage using property
 BufferImage NewBufferImage( const Property::Value& map )
 {
   BufferImage image = BufferImage::DownCast( NewImage( map ) );
index d6300de..05681a9 100644 (file)
@@ -966,7 +966,7 @@ int UtcDaliTapGestureEmitIncorrectStateClear(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -999,7 +999,7 @@ int UtcDaliTapGestureEmitIncorrectStateContinuing(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1032,7 +1032,7 @@ int UtcDaliTapGestureEmitIncorrectStateFinished(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
index d38de86..8362803 100644 (file)
@@ -20,6 +20,7 @@
 #include <limits>
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
+#include <dali/internal/event/common/type-info-impl.h>
 #include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
 #include <dali/integration-api/events/pinch-gesture-event.h>
@@ -843,7 +844,6 @@ int UtcDaliTypeRegistryTypeRegistrationForNamedTypeP(void)
   END_TEST;
 }
 
-// Note: No negative test case for UtcDaliTypeRegistryRegisteredName can be implemented.
 int UtcDaliTypeRegistryRegisteredNameP(void)
 {
   TestApplication application;
@@ -861,6 +861,32 @@ int UtcDaliTypeRegistryRegisteredNameP(void)
   END_TEST;
 }
 
+
+int UtcDaliTypeRegistryRegisteredNameN(void)
+{
+  TestApplication application;
+
+  DALI_TEST_CHECK( scriptedName == scriptedType.RegisteredName() );
+
+  TypeInfo baseType = TypeRegistry::Get().GetTypeInfo( scriptedName );
+  DALI_TEST_CHECK( baseType );
+
+  // should cause an assert because we're registering same type twice
+  // once statically at the start of this file, then again now
+  try
+  {
+    TypeRegistration scriptedType( scriptedName, typeid(Dali::CustomActor), CreateCustomNamedInit );
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Duplicate type name for Type Registation", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+
 int UtcDaliTypeRegistrySignalConnectorTypeP(void)
 {
   ResetFunctorCounts();
@@ -1491,6 +1517,12 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void)
   // Check property count are not changed because the child properties will not be created for the parent
   DALI_TEST_EQUALS( initialPropertyCount, customActor.GetPropertyCount(), TEST_LOCATION );
 
+  // check the child property type
+  Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+  Property::Type type = typeInfoImpl.GetChildPropertyType( typeInfoImpl.GetChildPropertyIndex("childProp4") );
+  DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+
   // Create a child actor
   Actor childActor = Actor::New();
   DALI_TEST_CHECK( childActor );
@@ -1650,6 +1682,7 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void)
   // Should return the child property index by given its name
   DALI_TEST_EQUALS( childActor.GetPropertyIndex( newPropertyName ), newPropertyIndex, TEST_LOCATION );
 
+
   END_TEST;
 }
 
@@ -1786,7 +1819,7 @@ int UtcDaliPropertyRegistrationAddSameIndex(void)
   END_TEST;
 }
 
-int UtcDaliPropertyRegistrationPropertyWritable(void)
+int UtcDaliPropertyRegistrationPropertyWritableP(void)
 {
   TestApplication application;
   int propertyIndex1 = PROPERTY_REGISTRATION_START_INDEX + 200;
@@ -1807,9 +1840,36 @@ int UtcDaliPropertyRegistrationPropertyWritable(void)
   // Check whether properties are writable
   DALI_TEST_CHECK(   customActor.IsPropertyWritable( propertyIndex1 ) );
   DALI_TEST_CHECK( ! customActor.IsPropertyWritable( propertyIndex2 ) );
+
+
+  // Check the property is writable in the type registry
+  Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+
+  DALI_TEST_EQUALS( typeInfoImpl.IsPropertyWritable( propertyIndex1 ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
+int UtcDaliPropertyRegistrationPropertyWritableN(void)
+{
+  // Currently Actors don't register properties with the type registry
+
+  TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) );
+  Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+
+  try
+  {
+    typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR);
+    tet_result( TET_FAIL );
+
+  }
+  catch ( DaliException& e )
+  {
+     DALI_TEST_ASSERT( e, "Cannot find property index", TEST_LOCATION );
+  }
+  END_TEST;
+
+}
 int UtcDaliPropertyRegistrationPropertyAnimatable(void)
 {
   TestApplication application;
@@ -2091,6 +2151,25 @@ int UtcDaliTypeInfoGetActionNameP(void)
 
   DALI_TEST_EQUALS( name, "show", TEST_LOCATION );
 
+
+  TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" );
+
+  //  search for show action in base class, given a derived class
+  bool foundChildAction = false;
+  for( std::size_t i = 0; i < typeInfo2.GetActionCount(); i++ )
+  {
+
+       std::string name = typeInfo2.GetActionName( i );
+       if( name == "show")
+       {
+         foundChildAction = true;
+       }
+
+  }
+
+  DALI_TEST_EQUALS( foundChildAction, true, TEST_LOCATION );
+
+
   END_TEST;
 }
 
@@ -2125,6 +2204,23 @@ int UtcDaliTypeInfoGetSignalNameP(void)
 
   DALI_TEST_EQUALS( name, "touched", TEST_LOCATION );
 
+  TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" );
+
+  //  search for signal in base class, given a derived class
+  bool foundSignal = false;
+  for( std::size_t i = 0; i < typeInfo2.GetSignalCount(); i++ )
+  {
+
+       std::string name = typeInfo2.GetSignalName( i );
+       if( name == "touched")
+       {
+         foundSignal = true;
+       }
+
+  }
+
+  DALI_TEST_EQUALS( foundSignal, true, TEST_LOCATION );
+
   END_TEST;
 }
 
diff --git a/build/scripts/generate-shader-strings.pl b/build/scripts/generate-shader-strings.pl
deleted file mode 100755 (executable)
index cafaa23..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-#!/usr/bin/perl -w
-
-###############################################################################
-
-use strict;
-use FileHandle;
-use Getopt::Long;
-use Pod::Usage;
-
-###############################################################################
-
-sub OpenFileForWriting
-{
-  my($fileName) = shift;
-
-  my $fh = FileHandle->new;
-  if (!$fh->open("> $fileName"))
-  {
-    die "Can't open $fileName for writing: $!\n";
-  }
-  return $fh;
-}
-
-###############################################################################
-
-sub CloseFile
-{
-  my($fh) = shift;
-  $fh->close;
-}
-
-###############################################################################
-
-sub GenerateHeaderFileHeader
-{
-  my($headerFile) = shift;
-  my $time=localtime();
-  print $headerFile <<"H_HEADER_END";
-//
-// Automatically Generated on $time
-//
-
-#ifndef __DALI_GENERATED_SHADERS_H_
-#define __DALI_GENERATED_SHADERS_H_
-
-namespace Dali
-{
-namespace Internal
-{
-
-H_HEADER_END
-}
-
-###############################################################################
-
-sub GenerateHeaderFileFooter
-{
-  my($headerFile) = shift;
-  print $headerFile <<"H_FOOTER_END";
-
-} // namespace Internal
-} // namespace Dali
-
-#endif // __DALI_GENERATED_SHADERS_H_
-H_FOOTER_END
-}
-
-###############################################################################
-
-sub GenerateSourceFileHeader
-{
-  my($sourceFile) = shift;
-  my $time=localtime();
-  print $sourceFile <<"CPP_HEADER_END";
-//
-// Automatically Generated on $time
-//
-
-namespace Dali
-{
-namespace Internal
-{
-
-CPP_HEADER_END
-}
-
-###############################################################################
-
-sub GenerateSourceFileFooter
-{
-  my($sourceFile) = shift;
-  print $sourceFile <<"CPP_FOOTER_END";
-} // namespace Internal
-} // namespace Dali
-CPP_FOOTER_END
-}
-
-###############################################################################
-
-my %shaders=();
-
-sub GenerateStringsFromFile
-{
-  my($file) = shift;
-  my($dir) = shift;
-
-  my $shadername = $file;
-  $shadername =~ s/-([a-z])/uc($1)/eg;
-  $shadername =~ s/^([a-z])/uc($1)/e;
-  $shadername =~ s/\.txt$//;
-
-  my $state = 0;
-
-  my $shader="";
-  open MEM, "$dir/$file" || die "Can't open $file for reading: $!\n";
-  while(<MEM>)
-  {
-    chomp;
-    if ($state == 0)
-    {
-      if (/<VertexShader>/)
-      {
-        $state = 1;
-        $shader = "";
-      }
-      elsif (/<FragmentShader>/)
-      {
-        $state = 1;
-        $shader = "";
-      }
-    }
-    elsif ($state == 1)
-    {
-      if (m!</VertexShader>!)
-      {
-        $state = 0;
-        $shaders{$shadername}->{"vertex"} = $shader;
-      }
-      elsif( m!</FragmentShader>!)
-      {
-        $state = 0;
-        $shaders{$shadername}->{"fragment"} = $shader;
-      }
-      else
-      {
-        ## Accumulate
-        $shader .= "$_\n";
-#       print $sourceFile "\"$_\\n\"\n";
-      }
-    }
-  }
-  close MEM;
-}
-
-###############################################################################
-
-sub GetShaderFiles
-{
-  my ($dir) = shift;
-  opendir (DIR, $dir) || die "Can't open $dir for reading: $!\n";
-  my @shaderFiles = grep { /\.txt$/ && -f "$dir/$_" } readdir DIR;
-  closedir DIR;
-  return @shaderFiles;
-}
-
-###############################################################################
-
-sub PrintSourceLine
-{
-    my $sourceFile=shift;
-    my $line=shift;
-    chomp $line;
-    $line =~ s!//.*$!!; # Strip out comments
-    $line =~ s!\s*$!!; # Strip out trailing space
-    if( $line !~ m!^\s*$! )
-    {
-        print $sourceFile "\"$line\\n\"\n";
-    }
-}
-
-sub PrintMacroLine
-{
-    my $sourceFile=shift;
-    my $line=shift;
-    chomp $line;
-    $line =~ s!//.*$!!; # Strip out comments
-    $line =~ s!\s*$!!; # Strip out trailing space
-    if( $line !~ m!^\s*$! )
-    {
-        print $sourceFile "\"$line\\n\" \\\n";
-    }
-}
-
-
-sub PrintShaderProgramWithMacros
-{
-    my $sourceFile=shift;
-    my $shadername=shift;
-    my $SHADERNAME=$shadername;
-    $SHADERNAME =~ s/([A-Z])/_$1/g;
-    substr($SHADERNAME,0,1)="";
-    $SHADERNAME = uc($SHADERNAME);
-
-    my $program_type=shift;
-    my $ProgramType=ucfirst($program_type);
-    my $PROGRAM_TYPE=uc($program_type);
-    my $custom=shift;
-
-    my @lines=split(/\n/, $shaders{$shadername}->{$program_type} );
-
-    print $sourceFile "#define ${SHADERNAME}_PREFIX_${PROGRAM_TYPE} \\\n";
-    LINE: while( scalar(@lines) )
-    {
-        last LINE if $lines[0] =~ /main()/;
-        PrintMacroLine($sourceFile, shift(@lines));
-    }
-    print $sourceFile "\n\n";
-
-    print $sourceFile "#define ${SHADERNAME}_POSTFIX_${PROGRAM_TYPE} \\\n";
-    LINE: while( scalar(@lines) )
-    {
-        PrintMacroLine($sourceFile, shift(@lines));
-    }
-    print $sourceFile "\n\n";
-
-    if($custom)
-    {
-        print $sourceFile "extern const char* const Custom${shadername}Prefix${ProgramType};\n";
-        print $sourceFile "const char* const Custom${shadername}Prefix${ProgramType}(\n";
-        print $sourceFile "  ${SHADERNAME}_PREFIX_${PROGRAM_TYPE}\n";
-        print $sourceFile ");\n\n";
-
-        print $sourceFile "extern const char* const Custom${shadername}Postfix${ProgramType};\n";
-        print $sourceFile "const char* const Custom${shadername}Postfix${ProgramType}(\n";
-        print $sourceFile "  ${SHADERNAME}_POSTFIX_${PROGRAM_TYPE}\n";
-        print $sourceFile ");\n\n";
-    }
-    print $sourceFile "extern const char* const ${shadername}${ProgramType};\n";
-    print $sourceFile "const char* const ${shadername}${ProgramType}(\n";
-    print $sourceFile "  ${SHADERNAME}_PREFIX_${PROGRAM_TYPE}\n";
-    print $sourceFile "  ${SHADERNAME}_POSTFIX_${PROGRAM_TYPE}\n";
-    print $sourceFile ");\n\n";
-
-}
-
-sub PrintShaderProgram
-{
-    my $sourceFile=shift;
-    my $shadername=shift;
-    my $program_type=shift;
-    my $custom=shift;
-    my $ProgramType=ucfirst($program_type);
-
-    my @lines=split(/\n/, $shaders{$shadername}->{$program_type} );
-
-    print $sourceFile "const char* const ${shadername}${ProgramType}(\n";
-    for my $i (0..scalar(@lines)-1)
-    {
-        PrintSourceLine($sourceFile, $lines[$i]);
-    }
-    print $sourceFile ");\n\n";
-
-    if( $custom )
-    {
-        print $sourceFile "const char* const Custom${shadername}Prefix${ProgramType}(\n";
-      LINE:
-        while( scalar(@lines) )
-        {
-            last LINE if $lines[0] =~ /main()/;
-            PrintSourceLine($sourceFile, shift(@lines));
-        }
-        print $sourceFile ");\n\n";
-
-        print $sourceFile "const char* const Custom${shadername}Postfix${ProgramType}(\n";
-
-        while( scalar(@lines) )
-        {
-            PrintSourceLine($sourceFile, shift(@lines));
-        }
-        print $sourceFile ");\n\n";
-    }
-}
-
-
-sub PrintShaderSources
-{
-  my($headerFile) = shift;
-  my($sourceFile) = shift;
-  my $shadername;
-
-  # Strings are now in memory. Dump them back out again:
-  foreach $shadername (sort(keys(%shaders)))
-  {
-    print $headerFile "extern const char* const ${shadername}Vertex;\n";
-    print $headerFile "extern const char* const ${shadername}Fragment;\n";
-
-    my $custom = 0;
-    if( $shadername !~ /TextDistanceField/ || $shadername eq "TextDistanceField" )
-    {
-        print $headerFile "extern const char* const Custom${shadername}PrefixVertex;\n";
-        print $headerFile "extern const char* const Custom${shadername}PostfixVertex;\n";
-        print $headerFile "extern const char* const Custom${shadername}PrefixFragment;\n";
-        print $headerFile "extern const char* const Custom${shadername}PostfixFragment;\n";
-        $custom = 1;
-    }
-    PrintShaderProgramWithMacros($sourceFile, $shadername, "vertex", $custom);
-    PrintShaderProgramWithMacros($sourceFile, $shadername, "fragment", $custom);
-  }
-}
-
-###############################################################################
-
-my($optHelp);
-my($optMan);
-my($shaderDir) = "";
-my($fileName) = "";
-
-GetOptions(
-  "help"           => \$optHelp,
-  "man"            => \$optMan,
-  "shader-dir=s"   => \$shaderDir,
-  "file-name=s"  => \$fileName
-) or pod2usage(2);
-
-pod2usage(1) if $optHelp;
-pod2usage(-exitstatus => 0, -verbose => 2) if $optMan;
-
-if ($shaderDir eq "" || $fileName eq "")
-{
-  pod2usage(1);
-}
-else
-{
-  my $dir = $shaderDir;
-  my @shaderFiles = GetShaderFiles($dir);
-
-  my $headerFile = OpenFileForWriting("$fileName.h");
-  my $sourceFile = OpenFileForWriting("$fileName.cpp");
-
-  GenerateHeaderFileHeader($headerFile);
-  GenerateSourceFileHeader($sourceFile);
-
-  my $file;
-  foreach $file (@shaderFiles)
-  {
-    GenerateStringsFromFile($file, $dir);
-  }
-
-  PrintShaderSources($headerFile, $sourceFile);
-
-  GenerateHeaderFileFooter($headerFile);
-  GenerateSourceFileFooter($sourceFile);
-
-  CloseFile($headerFile);
-  CloseFile($sourceFile);
-}
-
-###############################################################################
-
-__END__
-
-=head1 NAME
-
-generate-shader-strings.pl - Given a shader directory and a file name, this script generates a header and source file where all the shaders in the directory are stored as vertex and fragment shader const char arrays.
-
-=head1 SYNOPSIS
-
-generate-shader-strings.pl -s=<shader-dir> -f=<file-name>
-
-generate-shader-strings.pl -shader-dir=<shader-dir> -file-name=<file-name>
-
-=head1 DESCRIPTION
-
-Given a shader directory and a file name, this script generates a header and source file where all the shaders in the directory are stored as vertex and fragment shader const char arrays.
-
-The shader files in the specified directory should have the suffix ".txt" and the vertex and fragment shaders should be encapsulated within <VertexShader>*</VertexShader> and <FragmentShader>*</FragmentShader> respectively in this text file.
-
-The generated source files will be called <file-name>.h and <file-name>.cpp.
-
-=head1 OPTIONS
-
-=over 36
-
-=item B<-s|--shader-dir=<shader-directory>>
-
-The directory the shader files should be loaded from.
-
-=item B<-f|--file-name>
-
-The name of the output files.
index 58e6afe..ad081d5 100644 (file)
@@ -34,26 +34,12 @@ include ../../../doc/file.list
 
 # Build the Dali libtool library
 
-src_files = $(internal_src_files) \
-            $(platform_abstraction_src_files) \
-            $(public_api_src_files) \
-            $(devel_api_src_files)
-
 lib_LTLIBRARIES = libdali-core.la
 
-libdali_core_la_SOURCES = $(dali_shaders_src_file) \
-                          $(src_files)
-
-scripts_dir = ../../scripts
-dali_shaders_script = $(scripts_dir)/generate-shader-strings.pl
-dali_shaders_dir = ../../../dali/internal/render/shader-source
-
-$(nodist_libdali_core_la_OBJECTS): $(dali_shaders_src_file)
-
-dali_shaders_src_file = dali-shaders.cpp
-
-dali-shaders.cpp: $(dali_shaders_script) $(dali_shaders_dir)/*.txt
-       $< --shader-dir=$(dali_shaders_dir) --file-name=dali-shaders
+libdali_core_la_SOURCES = $(internal_src_files) \
+                          $(platform_abstraction_src_files) \
+                          $(public_api_src_files) \
+                          $(devel_api_src_files)
 
 dali_core_includes = \
         -I../../..
@@ -91,7 +77,6 @@ develapirenderingdir = $(develapidir)/rendering
 develapiscriptingdir = $(develapidir)/scripting
 develapisignalsdir = $(develapidir)/signals
 develapithreadingdir = $(develapidir)/threading
-develapishadereffectsdir = $(develapidir)/shader-effects
 
 develapi_HEADERS = $(devel_api_header_files)
 develapiactors_HEADERS = $(devel_api_core_actors_header_files)
@@ -105,7 +90,6 @@ develapirendering_HEADERS = $(devel_api_core_rendering_header_files)
 develapiscripting_HEADERS = $(devel_api_core_scripting_header_files)
 develapisignals_HEADERS = $(devel_api_core_signals_header_files)
 develapithreading_HEADERS = $(devel_api_core_threading_header_files)
-develapishadereffects_HEADERS = $(devel_api_core_shader_effects_header_files)
 
 #public api
 publicapidir = $(devincludepath)/dali/public-api
@@ -134,9 +118,6 @@ publicapirendertasks_HEADERS = $(public_api_core_render_tasks_header_files)
 publicapisignals_HEADERS = $(public_api_core_signals_header_files)
 publicapisizenegotiation_HEADERS = $(public_api_core_size_negotiation_header_files)
 
-CLEANFILES = dali-shaders.cpp \
-             dali-shaders.h
-
 # package doxygen file (contains doxygen grouping information)
 packagedoxydir = $(devincludepath)/dali/doc
 packagedoxy_HEADERS = $(package_doxy_files)
diff --git a/dali/devel-api/actors/actor-devel.h b/dali/devel-api/actors/actor-devel.h
new file mode 100644 (file)
index 0000000..fd7230f
--- /dev/null
@@ -0,0 +1,105 @@
+#ifndef DALI_ACTOR_DEVEL_H
+#define DALI_ACTOR_DEVEL_H
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
+
+namespace Dali
+{
+
+namespace DevelActor
+{
+
+namespace Property
+{
+
+enum Type
+{
+  PARENT_ORIGIN        = Dali::Actor::Property::PARENT_ORIGIN,
+  PARENT_ORIGIN_X      = Dali::Actor::Property::PARENT_ORIGIN_X,
+  PARENT_ORIGIN_Y      = Dali::Actor::Property::PARENT_ORIGIN_Y,
+  PARENT_ORIGIN_Z      = Dali::Actor::Property::PARENT_ORIGIN_Z,
+  ANCHOR_POINT         = Dali::Actor::Property::ANCHOR_POINT,
+  ANCHOR_POINT_X       = Dali::Actor::Property::ANCHOR_POINT_X,
+  ANCHOR_POINT_Y       = Dali::Actor::Property::ANCHOR_POINT_Y,
+  ANCHOR_POINT_Z       = Dali::Actor::Property::ANCHOR_POINT_Z,
+  SIZE                 = Dali::Actor::Property::SIZE,
+  SIZE_WIDTH           = Dali::Actor::Property::SIZE_WIDTH,
+  SIZE_HEIGHT          = Dali::Actor::Property::SIZE_HEIGHT,
+  SIZE_DEPTH           = Dali::Actor::Property::SIZE_DEPTH,
+  POSITION             = Dali::Actor::Property::POSITION,
+  POSITION_X           = Dali::Actor::Property::POSITION_X,
+  POSITION_Y           = Dali::Actor::Property::POSITION_Y,
+  POSITION_Z           = Dali::Actor::Property::POSITION_Z,
+  WORLD_POSITION       = Dali::Actor::Property::WORLD_POSITION,
+  WORLD_POSITION_X     = Dali::Actor::Property::WORLD_POSITION_X,
+  WORLD_POSITION_Y     = Dali::Actor::Property::WORLD_POSITION_Y,
+  WORLD_POSITION_Z     = Dali::Actor::Property::WORLD_POSITION_Z,
+  ORIENTATION          = Dali::Actor::Property::ORIENTATION,
+  WORLD_ORIENTATION    = Dali::Actor::Property::WORLD_ORIENTATION,
+  SCALE                = Dali::Actor::Property::SCALE,
+  SCALE_X              = Dali::Actor::Property::SCALE_X,
+  SCALE_Y              = Dali::Actor::Property::SCALE_Y,
+  SCALE_Z              = Dali::Actor::Property::SCALE_Z,
+  WORLD_SCALE          = Dali::Actor::Property::WORLD_SCALE,
+  VISIBLE              = Dali::Actor::Property::VISIBLE,
+  COLOR                = Dali::Actor::Property::COLOR,
+  COLOR_RED            = Dali::Actor::Property::COLOR_RED,
+  COLOR_GREEN          = Dali::Actor::Property::COLOR_GREEN,
+  COLOR_BLUE           = Dali::Actor::Property::COLOR_BLUE,
+  COLOR_ALPHA          = Dali::Actor::Property::COLOR_ALPHA,
+  WORLD_COLOR          = Dali::Actor::Property::WORLD_COLOR,
+  WORLD_MATRIX         = Dali::Actor::Property::WORLD_MATRIX,
+  NAME                 = Dali::Actor::Property::NAME,
+  SENSITIVE            = Dali::Actor::Property::SENSITIVE,
+  LEAVE_REQUIRED       = Dali::Actor::Property::LEAVE_REQUIRED,
+  INHERIT_ORIENTATION  = Dali::Actor::Property::INHERIT_ORIENTATION,
+  INHERIT_SCALE        = Dali::Actor::Property::INHERIT_SCALE,
+  COLOR_MODE           = Dali::Actor::Property::COLOR_MODE,
+  POSITION_INHERITANCE = Dali::Actor::Property::POSITION_INHERITANCE,
+  DRAW_MODE            = Dali::Actor::Property::DRAW_MODE,
+  SIZE_MODE_FACTOR     = Dali::Actor::Property::SIZE_MODE_FACTOR,
+  WIDTH_RESIZE_POLICY  = Dali::Actor::Property::WIDTH_RESIZE_POLICY,
+  HEIGHT_RESIZE_POLICY = Dali::Actor::Property::HEIGHT_RESIZE_POLICY,
+  SIZE_SCALE_POLICY    = Dali::Actor::Property::SIZE_SCALE_POLICY,
+  WIDTH_FOR_HEIGHT     = Dali::Actor::Property::WIDTH_FOR_HEIGHT,
+  HEIGHT_FOR_WIDTH     = Dali::Actor::Property::HEIGHT_FOR_WIDTH,
+  PADDING              = Dali::Actor::Property::PADDING,
+  MINIMUM_SIZE         = Dali::Actor::Property::MINIMUM_SIZE,
+  MAXIMUM_SIZE         = Dali::Actor::Property::MAXIMUM_SIZE,
+  INHERIT_POSITION     = Dali::Actor::Property::INHERIT_POSITION,
+  CLIPPING_MODE        = Dali::Actor::Property::CLIPPING_MODE,
+
+    /**
+     * @brief name "batchParent", type BOOLEAN
+     * @see Batching
+     * @note The default value is 'false'
+     */
+  BATCH_PARENT         = CLIPPING_MODE + 1,
+  SIBLING_ORDER          = CLIPPING_MODE + 2,
+};
+
+} // namespace Property
+
+} // namespace DevelActor
+
+} // namespace Dali
+
+#endif // DALI_ACTOR_DEVEL_H
diff --git a/dali/devel-api/actors/layer-devel.h b/dali/devel-api/actors/layer-devel.h
new file mode 100644 (file)
index 0000000..47e7a02
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef DALI_LAYER_DEVEL_H
+#define DALI_LAYER_DEVEL_H
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
+
+namespace Dali
+{
+
+namespace DevelLayer
+{
+
+  /**
+   * @brief TREE_DEPTH_MULTIPLIER is used by the rendering sorting algorithm to decide which actors to render first.
+   * @SINCE_1_0.0
+   */
+  enum TreeDepthMultiplier
+  {
+    TREE_DEPTH_MULTIPLIER = 1000000,
+  };
+
+  /**
+  * @brief SIBLING_ORDER_MULTIPLIER is used by the rendering sorting algorithm to decide which actors to render first.
+  * @SINCE_1_2.16
+  */
+ enum SiblingOrderMultiplier
+ {
+   SIBLING_ORDER_MULTIPLIER = 1000,
+ };
+
+}
+
+}
+
+#endif  //DALI_LAYER_DEVEL_H
index 3543712..fa9844f 100644 (file)
@@ -1,4 +1,4 @@
-# Add devel source files here for DALi internal developer files used by Adaptor & Toolkit 
+# Add devel source files here for DALi internal developer files used by Adaptor & Toolkit
 devel_api_src_files = \
   $(devel_api_src_dir)/animation/animation-data.cpp \
   $(devel_api_src_dir)/animation/path-constrainer.cpp \
@@ -8,16 +8,21 @@ devel_api_src_files = \
   $(devel_api_src_dir)/images/distance-field.cpp \
   $(devel_api_src_dir)/images/texture-set-image.cpp \
   $(devel_api_src_dir)/images/nine-patch-image.cpp \
+  $(devel_api_src_dir)/object/handle-devel.cpp \
   $(devel_api_src_dir)/object/weak-handle.cpp \
+  $(devel_api_src_dir)/object/csharp-type-registry.cpp \
   $(devel_api_src_dir)/scripting/scripting.cpp \
   $(devel_api_src_dir)/signals/signal-delegate.cpp \
   $(devel_api_src_dir)/threading/conditional-wait.cpp \
   $(devel_api_src_dir)/threading/mutex.cpp \
-  $(devel_api_src_dir)/threading/thread.cpp \
-  $(devel_api_src_dir)/shader-effects/shader-effect.cpp
+  $(devel_api_src_dir)/threading/thread.cpp
 
 # Add devel header files here DALi internal developer files used by Adaptor & Toolkit
 
+devel_api_core_actors_header_files = \
+  $(devel_api_src_dir)/actors/actor-devel.h \
+  $(devel_api_src_dir)/actors/layer-devel.h
+
 devel_api_core_animation_header_files = \
   $(devel_api_src_dir)/animation/animation-data.h \
   $(devel_api_src_dir)/animation/path-constrainer.h
@@ -40,8 +45,14 @@ devel_api_core_images_header_files = \
   $(devel_api_src_dir)/images/nine-patch-image.h
 
 devel_api_core_object_header_files = \
+  $(devel_api_src_dir)/object/csharp-type-info.h \
+  $(devel_api_src_dir)/object/csharp-type-registry.h \
+  $(devel_api_src_dir)/object/handle-devel.h \
   $(devel_api_src_dir)/object/weak-handle.h
 
+devel_api_core_rendering_header_files = \
+  $(devel_api_src_dir)/rendering/renderer-devel.h
+
 devel_api_core_signals_header_files = \
   $(devel_api_src_dir)/signals/signal-delegate.h
 
@@ -53,6 +64,3 @@ devel_api_core_threading_header_files = \
   $(devel_api_src_dir)/threading/conditional-wait.h \
   $(devel_api_src_dir)/threading/mutex.h \
   $(devel_api_src_dir)/threading/thread.h
-
-devel_api_core_shader_effects_header_files = \
-  $(devel_api_src_dir)/shader-effects/shader-effect.h
diff --git a/dali/devel-api/object/csharp-type-info.h b/dali/devel-api/object/csharp-type-info.h
new file mode 100644 (file)
index 0000000..7f7831d
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __DALI_CSHARP_TYPE_INFO_H__
+#define __DALI_CSHARP_TYPE_INFO_H__
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/property-value.h>
+
+namespace Dali
+{
+
+namespace CSharpTypeInfo
+{
+
+  typedef BaseHandle* (*CreateFunction)(); ///< Function signature for creating an instance of the associated object type
+
+  /**
+   * @brief Callback to set an event-thread only property.
+   *
+   * @param[in] object The object whose property should be set.
+   * @param[in] index The index of the property being set.
+   * @param[in] value The new value of the property for the object specified.
+   * @see PropertyRegistration.
+   */
+  typedef void (*SetPropertyFunction)( BaseObject* object, Property::Index* index, Property::Value* value );
+
+
+  /**
+   * @brief Callback to get the value of an event-thread only property.
+   *
+   * @param[in] object The object whose property value is required.
+   * @param[in] index The index of the property required.
+   * @return The current value of the property for the object specified.
+   * @see PropertyRegistration.
+   */
+  typedef Property::Value* (*GetPropertyFunction)( BaseObject* object, Property::Index* index );
+}
+
+
+} // namespace Dali
+
+#endif // __DALI_CSHARP_INFO_H__
diff --git a/dali/devel-api/object/csharp-type-registry.cpp b/dali/devel-api/object/csharp-type-registry.cpp
new file mode 100644 (file)
index 0000000..0d058b5
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/object/csharp-type-registry.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/event/common/type-registry-impl.h>
+
+namespace Dali
+{
+
+namespace CSharpTypeRegistry
+{
+
+bool RegisterType( const std::string& name, const std::type_info& baseType, CSharpTypeInfo::CreateFunction f, bool callCreateOnInit )
+{
+  Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
+
+  return impl->Register( name, baseType, f, callCreateOnInit );
+}
+
+bool RegisterProperty( const std::string& objectName,
+                       const std::string& name,
+                       Property::Index index,
+                       Property::Type type,
+                       CSharpTypeInfo::SetPropertyFunction setFunc,
+                       CSharpTypeInfo::GetPropertyFunction getFunc )
+{
+
+  Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
+
+  return impl->RegisterProperty( objectName, name, index, type, setFunc, getFunc );
+}
+
+}
+
+} // namespace Dali
diff --git a/dali/devel-api/object/csharp-type-registry.h b/dali/devel-api/object/csharp-type-registry.h
new file mode 100644 (file)
index 0000000..156ecb5
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef __DALI_CSHARP_TYPE_REGISTRY_H__
+#define __DALI_CSHARP_TYPE_REGISTRY_H__
+
+/*
+ * 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 <typeinfo>
+
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/object/csharp-type-info.h>
+
+namespace Dali
+{
+
+
+/**
+ * Custom static functions for registering C# custom controls and properties
+ *
+ */
+namespace CSharpTypeRegistry
+{
+
+/**
+ * @brief Constructor registers the type creation function for a named class or type.
+ *
+ * This allows types to be created dynamically from script. The name must be
+ * unique for successful registration.
+ * @param [in] name the name of the type to be registered
+ * @param [in] baseType the base type info of registerType
+ * @param [in] f registerType instance creation function
+ * @param [in] callCreateOnInit If true the creation function is called as part of Dali initialisation
+ * @return true if the name could be registered.
+ */
+  DALI_IMPORT_API bool RegisterType( const std::string& name,
+                                     const std::type_info& baseType,
+                                     CSharpTypeInfo::CreateFunction f,
+                                     bool callCreateOnInit );
+
+  /**
+   * Register an event-thread only property with a type (used by C# Custom controls)
+   * @param [in] objectName name of the object used to register the type
+   * @param [in] name Property name
+   * @param [in] index Property index
+   * @param [in] type Property type
+   * @param [in] setFunc The function to set the property (Can be NULL).
+   * @param [in] getFunc The function to get the value of a property.
+   * @return true if the property could be registered.
+  */
+  DALI_IMPORT_API bool RegisterProperty( const std::string& objectName,
+                                         const std::string& name,
+                                         Property::Index index,
+                                         Property::Type type,
+                                         CSharpTypeInfo::SetPropertyFunction setFunc,
+                                         CSharpTypeInfo::GetPropertyFunction getFunc );
+}
+
+} // namespace Dali
+
+#endif // header
diff --git a/dali/devel-api/object/handle-devel.cpp b/dali/devel-api/object/handle-devel.cpp
new file mode 100644 (file)
index 0000000..f1057fe
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ *
+ */
+
+// FILE HEADER
+#include <dali/devel-api/object/handle-devel.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/property-key.h>
+#include <dali/internal/event/common/object-impl.h>
+
+namespace Dali
+{
+
+namespace DevelHandle
+{
+
+Property::Index GetPropertyIndex( const Handle& handle, Property::Index key )
+{
+  return GetImplementation( handle ).GetPropertyIndex( key );
+}
+
+Property::Index GetPropertyIndex( const Handle& handle, Property::Key key )
+{
+  return GetImplementation( handle ).GetPropertyIndex( key );
+}
+
+Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue )
+{
+  return GetImplementation( handle ).RegisterProperty( name, key, propertyValue );
+}
+
+} // namespace DevelHandle
+
+} // namespace Dali
diff --git a/dali/devel-api/object/handle-devel.h b/dali/devel-api/object/handle-devel.h
new file mode 100644 (file)
index 0000000..5a54a3d
--- /dev/null
@@ -0,0 +1,105 @@
+#ifndef DALI_HANDLE_DEVEL_H
+#define DALI_HANDLE_DEVEL_H
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/handle.h>
+
+namespace Dali
+{
+
+namespace DevelHandle
+{
+
+/**
+ * @brief Query the index of a custom property matching the given key.
+ *
+ * Returns the first custom property that matches the given integer key. This is
+ * useful for other classes that know the key but not the name. Requires the property
+ * to have been registered with the associated key.
+ *
+ * @note This key is not the same as the Property enum found in
+ * objects such as Actor (which is a preset index).
+ *
+ * @param[in] handle The handle from where to retrieve the property index.
+ * @param[in] key The integer key of the property
+ *
+ * @return The index of the property, or Property::INVALID_INDEX if no property exists with the given key.
+ *
+ * @note The key is not the same as the returned index, though it has the same type.
+ */
+DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property::Index key );
+
+/**
+ * @brief Query the index of a property using the given key from a Property::Map
+ *
+ * @param[in] handle The handle from where to retrieve the property index.
+ * @param[in] key The key of the property to search for.
+ *
+ * @return the matching property index of either the string key or the matching
+ * custom property index of the index key, or Property::INVALID_INDEX if no
+ * property matches the given key.
+ *
+ * @note See also, GetPropertyIndex(Property::Index) and GetPropertyIndex(const std::string&)
+ */
+DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property::Key key );
+
+/**
+ * @brief Register a new animatable property with an integer key.
+ *
+ * @param[in] handle The handle where to register the property.
+ * @param[in] key  The integer key of the property.
+ * @param[in] name The text key of the property.
+ * @param[in] propertyValue The new value of the property.
+ *
+ * @return The index of the property or Property::INVALID_INDEX if registration failed
+ *
+ * @pre The object supports dynamic properties i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true.
+ * Property names and keys are expected to be unique, but this is not enforced.
+ * Property indices are unique to each registered custom property in a given object.
+ *
+ * @note Returns Property::INVALID_INDEX if registration failed. This can happen if you try to register
+ * animatable property on an object that does not have scene graph object.
+ *
+ * @note The returned property index is not the same as the integer key (though it shares a type)
+ *
+ * This version of RegisterProperty associates both an integer key
+ * and the text key with the property, allowing for lookup of the
+ * property index by either key or name ( which is useful when other
+ * classes know the key but not the name )
+ *
+ * @note Only the following types can be animated:
+ *       - Property::BOOLEAN
+ *       - Property::FLOAT
+ *       - Property::INTEGER
+ *       - Property::VECTOR2
+ *       - Property::VECTOR3
+ *       - Property::VECTOR4
+ *       - Property::MATRIX3
+ *       - Property::MATRIX
+ *       - Property::ROTATION
+ * @note If a property with the desired name already exists, then the value given is just set.
+ */
+DALI_IMPORT_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
+
+} // namespace DevelHandle
+
+} // namespace Dali
+
+#endif // DALI_HANDLE_DEVEL_H
diff --git a/dali/devel-api/rendering/renderer-devel.h b/dali/devel-api/rendering/renderer-devel.h
new file mode 100644 (file)
index 0000000..5f07acf
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef DALI_RENDERER_DEVEL_H
+#define DALI_RENDERER_DEVEL_H
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/rendering/renderer.h>
+
+namespace Dali
+{
+
+namespace DevelRenderer
+{
+
+namespace Property
+{
+
+  enum Type
+  {
+    DEPTH_INDEX                 = Dali::Renderer::Property::DEPTH_INDEX,
+    FACE_CULLING_MODE           = Dali::Renderer::Property::FACE_CULLING_MODE,
+    BLEND_MODE                  = Dali::Renderer::Property::BLEND_MODE,
+    BLEND_EQUATION_RGB          = Dali::Renderer::Property::BLEND_EQUATION_RGB,
+    BLEND_EQUATION_ALPHA        = Dali::Renderer::Property::BLEND_EQUATION_ALPHA,
+    BLEND_FACTOR_SRC_RGB        = Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB,
+    BLEND_FACTOR_DEST_RGB       = Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB,
+    BLEND_FACTOR_SRC_ALPHA      = Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA,
+    BLEND_FACTOR_DEST_ALPHA     = Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA,
+    BLEND_COLOR                 = Dali::Renderer::Property::BLEND_COLOR,
+    BLEND_PRE_MULTIPLIED_ALPHA  = Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA,
+    INDEX_RANGE_FIRST           = Dali::Renderer::Property::INDEX_RANGE_FIRST,
+    INDEX_RANGE_COUNT           = Dali::Renderer::Property::INDEX_RANGE_COUNT,
+    DEPTH_WRITE_MODE            = Dali::Renderer::Property::DEPTH_WRITE_MODE,
+    DEPTH_FUNCTION              = Dali::Renderer::Property::DEPTH_FUNCTION,
+    DEPTH_TEST_MODE             = Dali::Renderer::Property::DEPTH_TEST_MODE,
+    RENDER_MODE                 = Dali::Renderer::Property::RENDER_MODE,
+    STENCIL_FUNCTION            = Dali::Renderer::Property::STENCIL_FUNCTION,
+    STENCIL_FUNCTION_MASK       = Dali::Renderer::Property::STENCIL_FUNCTION_MASK,
+    STENCIL_FUNCTION_REFERENCE  = Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE,
+    STENCIL_MASK                = Dali::Renderer::Property::STENCIL_MASK,
+    STENCIL_OPERATION_ON_FAIL   = Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL,
+    STENCIL_OPERATION_ON_Z_FAIL = Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL,
+    STENCIL_OPERATION_ON_Z_PASS = Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS,
+
+    /**
+     * @brief name "batchingEnabled", type BOOLEAN
+     * @see Batching
+     * @note The default value is 'false'
+     */
+    BATCHING_ENABLED            = STENCIL_OPERATION_ON_Z_PASS + 1
+  };
+} // namespace Property
+
+} // namespace DevelRenderer
+
+} // namespace Dali
+
+#endif // DALI_RENDERER_DEVEL_H
index bb585ab..66f4132 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/public-api/actors/draw-mode.h>
 #include <dali/devel-api/animation/animation-data.h>
 #include <dali/public-api/images/image.h>
-#include <dali/devel-api/shader-effects/shader-effect.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/property-value.h>
diff --git a/dali/devel-api/shader-effects/shader-effect.cpp b/dali/devel-api/shader-effects/shader-effect.cpp
deleted file mode 100644 (file)
index 2046669..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/devel-api/shader-effects/shader-effect.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/event/effects/shader-effect-impl.h>
-#include <dali/internal/event/animation/constraint-impl.h>
-#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/math/vector2.h>
-
-namespace Dali
-{
-const float ShaderEffect::DEFAULT_GRID_DENSITY = 40;
-
-ShaderEffect::ShaderEffect()
-{
-}
-
-ShaderEffect::ShaderEffect(Internal::ShaderEffect* internal)
-: Handle(internal)
-{
-}
-
-ShaderEffect::~ShaderEffect()
-{
-}
-
-ShaderEffect::ShaderEffect(const ShaderEffect& handle)
-: Handle(handle)
-{
-}
-
-ShaderEffect& ShaderEffect::operator=(const ShaderEffect& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
-
-ShaderEffect ShaderEffect::New( const std::string& vertexShader, const std::string& fragmentShader, GeometryHints hints)
-{
-  Internal::ShaderEffectPtr internal = Internal::ShaderEffect::New( hints );
-
-  internal->SetPrograms( vertexShader, fragmentShader );
-
-  return ShaderEffect( internal.Get() );
-}
-
-ShaderEffect ShaderEffect::NewWithPrefix( const std::string& vertexShaderPrefix,
-                                          const std::string& vertexShader,
-                                          const std::string& fragmentShaderPrefix,
-                                          const std::string& fragmentShader,
-                                          GeometryHints hints)
-{
-  Internal::ShaderEffectPtr internal = Internal::ShaderEffect::New( hints );
-
-  internal->SetPrograms( vertexShaderPrefix, fragmentShaderPrefix, vertexShader, fragmentShader );
-
-  return ShaderEffect( internal.Get() );
-}
-
-ShaderEffect ShaderEffect::DownCast( BaseHandle handle )
-{
-  return ShaderEffect( dynamic_cast<Dali::Internal::ShaderEffect*>(handle.GetObjectPtr()) );
-}
-
-void ShaderEffect::SetEffectImage( Image image )
-{
-  GetImplementation(*this).SetEffectImage( image );
-}
-
-void ShaderEffect::SetUniform( const std::string& name, float value, UniformCoordinateType uniformCoordinateType )
-{
-  GetImplementation(*this).SetUniform( name, value, uniformCoordinateType );
-}
-
-void ShaderEffect::SetUniform( const std::string& name, Vector2 value, UniformCoordinateType uniformCoordinateType )
-{
-  GetImplementation(*this).SetUniform( name, value, uniformCoordinateType );
-}
-
-void ShaderEffect::SetUniform( const std::string& name, Vector3 value, UniformCoordinateType uniformCoordinateType )
-{
-  GetImplementation(*this).SetUniform( name, value, uniformCoordinateType );
-}
-
-void ShaderEffect::SetUniform( const std::string& name, Vector4 value, UniformCoordinateType uniformCoordinateType )
-{
-  GetImplementation(*this).SetUniform( name, value, uniformCoordinateType );
-}
-
-void ShaderEffect::SetUniform( const std::string& name, const Matrix& value, UniformCoordinateType uniformCoordinateType )
-{
-  GetImplementation(*this).SetUniform( name, value, uniformCoordinateType );
-}
-
-void ShaderEffect::SetUniform( const std::string& name, const Matrix3& value, UniformCoordinateType uniformCoordinateType )
-{
-  GetImplementation(*this).SetUniform( name, value, uniformCoordinateType );
-}
-
-} // namespace Dali
diff --git a/dali/devel-api/shader-effects/shader-effect.h b/dali/devel-api/shader-effects/shader-effect.h
deleted file mode 100644 (file)
index faea062..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-#ifndef __DALI_SHADER_EFFECT_H__
-#define __DALI_SHADER_EFFECT_H__
-
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/object/handle.h>
-#include <dali/public-api/object/property-index-ranges.h>
-
-namespace Dali
-{
-/**
- * @addtogroup dali_core_rendering_effects
- * @{
- */
-
-/**
- * @DEPRECATED_1_0.47
- * @brief DALI_COMPOSE_SHADER macro provides a convenient way to write shader source code.
- *
- * We normally use double quotation marks to write a string such as "Hello World".
- * However many symbols are needed to add multiple lines of string.
- * We don't need to write quotation marks using this macro at every line.
- *
- * [An example of double quotation marks usage]
- * const string FRAGMENT_SHADER_SOURCE = \
- * "  void main()\n"
- * "  {\n"
- * "    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n"
- * "  }\n";
- *
- * [An example of DALI_COMPOSE_SHADER usage]
- * const string VERTEX_SHADER_SOURCE = DALI_COMPOSE_SHADER (
- *   void main()
- *   {
- *     gl_Position = uMvpMatrix * vec4(aPosition, 1.0);
- *     vTexCoord = mix( sTextureRect.xy, sTextureRect.zw, aTexCoord) );
- *   }
- * );
- * @SINCE_1_0.0
- * @remarks This is an experimental feature and might not be supported in the next release. We do recommend not to use it.
- */
-#define DALI_COMPOSE_SHADER(STR) #STR
-
-class Image;
-struct Vector2;
-struct Vector3;
-struct Vector4;
-
-namespace Internal DALI_INTERNAL
-{
-class ShaderEffect;
-}
-
-/**
- * @DEPRECATED_1_0.47
- *
- * @brief Shader effects provide a visual effect for image actors.
- *
- * For a Custom shader you can provide the vertex and fragment shader code as strings.
- * These shader snippets get concatenated with the default attributes and uniforms.
- * For a vertex shader this part contains the following code:
- * <pre>
- * precision highp float;
- * attribute vec3  aPosition;
- * attribute vec2  aTexCoord;
- * uniform   mat4  uMvpMatrix;
- * uniform   mat4  uModelMatrix;
- * uniform   mat4  uViewMatrix;
- * uniform   mat4  uModelView;
- * uniform   mat3  uNormalMatrix;
- * uniform   mat4  uProjection;
- * uniform   vec4  uColor;
- * varying   vec2  vTexCoord;
- * </pre>
- * The custom shader part is expected to output the vertex position and texture coordinate.
- * A basic custom vertex shader would contain the following code:
- * <pre>
- * void main()
- * {
- *     gl_Position = uMvpMatrix * vec4(aPosition, 1.0);
- *     vTexCoord = mix( sTextureRect.xy, sTextureRect.zw, aTexCoord );
- * }
- * </pre>
- * For fragment shader the default part for images contains the following code:
- * <pre>
- * precision mediump float;
- * uniform   sampler2D sTexture;
- * uniform   sampler2D sEffect;
- * uniform   vec4      uColor;
- * varying   vec2      vTexCoord;
- * </pre>
- * @SINCE_1_0.0
- * @remarks This is an experimental feature and might not be supported in the next release. We do recommend not to use it.
- * @note In order for fade and color animations to work, the fragment shader needs to multiply the fragment color
- * with the uniform color "uColor" of the node.
- */
-class DALI_IMPORT_API ShaderEffect : public Handle
-{
-public:
-
-  // Default Properties
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief An enumeration of properties belonging to the ShaderEffect class.
-   *
-   * Grid Density defines the spacing of vertex coordinates in world units.
-   * ie a larger actor will have more grids at the same spacing.
-   *
-   *  +---+---+         +---+---+---+
-   *  |   |   |         |   |   |   |
-   *  +---+---+         +---+---+---+
-   *  |   |   |         |   |   |   |
-   *  +---+---+         +---+---+---+
-   *                    |   |   |   |
-   *                    +---+---+---+
-   * @SINCE_1_0.0
-   */
-  struct Property
-  {
-    enum
-    {
-      GRID_DENSITY = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< @DEPRECATED_1_0.47 @brief name "gridDensity",    type float @SINCE_1_0.0
-      IMAGE,                                             ///< @DEPRECATED_1_0.47 @brief name "image",          type Map {"filename":"", "loadPolicy":...} @SINCE_1_0.0
-      PROGRAM,                                           ///< @DEPRECATED_1_0.47 @brief name "program",        type Map {"vertexPrefix":"","fragmentPrefix":"","vertex":"","fragment":""} @SINCE_1_0.0
-      GEOMETRY_HINTS                                     ///< @DEPRECATED_1_0.47 @brief name "geometryHints",  type int (bitfield) values from enum GeometryHints @SINCE_1_0.0
-    };
-  };
-
-  static const float DEFAULT_GRID_DENSITY;              ///< The default density is 40 pixels
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Hints for rendering/subdividing geometry.
-   * @SINCE_1_0.0
-   */
-  enum GeometryHints
-  {
-    HINT_NONE           = 0x00,   ///< @DEPRECATED_1_0.47 @brief no hints @SINCE_1_0.0
-    HINT_GRID_X         = 0x01,   ///< @DEPRECATED_1_0.47 @brief Geometry must be subdivided in X @SINCE_1_0.0
-    HINT_GRID_Y         = 0x02,   ///< @DEPRECATED_1_0.47 @brief Geometry must be subdivided in Y @SINCE_1_0.0
-    HINT_GRID           = (HINT_GRID_X | HINT_GRID_Y),  ///< @DEPRECATED_1_0.47 @brief HINT_GRID_X | HINT_GRID_Y @SINCE_1_0.0
-    HINT_DEPTH_BUFFER   = 0x04,   ///< @DEPRECATED_1_0.47 @brief Needs depth buffering turned on @SINCE_1_0.0
-    HINT_BLENDING       = 0x08,   ///< @DEPRECATED_1_0.47 @brief Notifies the actor to use blending even if it's fully opaque. Needs actor's blending set to BlendingMode::AUTO @SINCE_1_0.0
-    HINT_DOESNT_MODIFY_GEOMETRY = 0x10 ///< @DEPRECATED_1_0.47 @brief Notifies that the vertex shader will not change geometry (enables bounding box culling) @SINCE_1_0.0
-  };
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Coordinate type of the shader uniform.
-   *
-   * Viewport coordinate types will convert from viewport to view space.
-   * Use this coordinate type if your are doing a transformation in view space.
-   * The texture coordinate type converts a value in actor local space to texture coodinates.
-   * This is useful for pixel shaders and accounts for texture atlas.
-   * @SINCE_1_0.0
-   */
-  enum UniformCoordinateType
-  {
-    COORDINATE_TYPE_DEFAULT,           ///< @DEPRECATED_1_0.47 @brief Default, No transformation to be applied @SINCE_1_0.0
-    COORDINATE_TYPE_VIEWPORT_POSITION, ///< @DEPRECATED_1_0.47 @brief The uniform is a position vector in viewport coordinates that needs to be converted to GL view space coordinates. @SINCE_1_0.0
-    COORDINATE_TYPE_VIEWPORT_DIRECTION ///< @DEPRECATED_1_0.47 @brief The uniform is a directional vector in viewport coordinates that needs to be converted to GL view space coordinates. @SINCE_1_0.0
-  };
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Create an empty ShaderEffect.
-   *
-   * This can be initialised with ShaderEffect::New(...)
-   * @SINCE_1_0.0
-   */
-  ShaderEffect();
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Create ShaderEffect.
-   *
-   * @SINCE_1_0.0
-   * @param vertexShader code for the effect. If you pass in an empty string, the default version will be used
-   * @param fragmentShader code for the effect. If you pass in an empty string, the default version will be used
-   * @param hints GeometryHints to define the geometry of the rendered object
-   * @return A handle to a shader effect
-   */
-  static ShaderEffect New( const std::string& vertexShader,
-                           const std::string& fragmentShader,
-                           GeometryHints hints = GeometryHints(HINT_NONE) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Create ShaderEffect.
-   * @SINCE_1_0.0
-   * @param vertexShaderPrefix code for the effect. It will be inserted before the default uniforms (ideal for \#defines)
-   * @param vertexShader code for the effect. If you pass in an empty string, the default version will be used
-   * @param fragmentShaderPrefix code for the effect. It will be inserted before the default uniforms (ideal for \#defines)
-   * @param fragmentShader code for the effect. If you pass in an empty string, the default version will be used
-   * @param hints GeometryHints to define the geometry of the rendered object
-   * @return A handle to a shader effect
-   */
-  static ShaderEffect NewWithPrefix(const std::string& vertexShaderPrefix,
-                                    const std::string& vertexShader,
-                                    const std::string& fragmentShaderPrefix,
-                                    const std::string& fragmentShader,
-                                    GeometryHints hints = GeometryHints(HINT_NONE) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Downcast a handle to ShaderEffect handle.
-   *
-   * If handle points to a ShaderEffect the downcast produces valid
-   * handle. If not the returned handle is left uninitialized.
-   *
-   * @SINCE_1_0.0
-   * @param[in] handle to An object
-   * @return handle to a ShaderEffect object or an uninitialized handle
-   */
-  static ShaderEffect DownCast( BaseHandle handle );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   * @SINCE_1_0.0
-   */
-  ~ShaderEffect();
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Copy constructor
-   *
-   * @SINCE_1_0.0
-   * @param object A reference to a ShaderEffect object
-   */
-  ShaderEffect(const ShaderEffect& object);
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief This assignment operator is required for (smart) pointer semantics.
-   *
-   * @SINCE_1_0.0
-   * @param [in] rhs  A reference to the copied handle
-   * @return A reference to this
-   */
-  ShaderEffect& operator=(const ShaderEffect& rhs);
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Sets image for using as effect texture.
-   *
-   * This image texture will be bound to the "sEffect" sampler
-   * so it can be used in fragment shader for effects
-   *
-   * @SINCE_1_0.0
-   * @param[in] image to use as effect texture
-   */
-  void SetEffectImage( Image image );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Set a uniform value.
-   *
-   * This will register a property of type Property::FLOAT; see Object::RegisterProperty() for more details.
-   * If name matches a uniform in the shader source, this value will be uploaded when rendering.
-   * @SINCE_1_0.0
-   * @param name The name of the uniform.
-   * @param value The value to to set.
-   * @param uniformCoordinateType The coordinate type of the uniform.
-   * @pre Either the property name is not in use, or a property exists with the correct name & type.
-   */
-  void SetUniform( const std::string& name,
-                   float value,
-                   UniformCoordinateType uniformCoordinateType = UniformCoordinateType(COORDINATE_TYPE_DEFAULT) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Set a uniform value.
-   *
-   * This will register a property of type Property::VECTOR2; see Object::RegisterProperty() for more details.
-   * If name matches a uniform in the shader source, this value will be uploaded when rendering.
-   * @SINCE_1_0.0
-   * @param name The name of the uniform.
-   * @param value The value to to set.
-   * @param uniformCoordinateType The coordinate type of the uniform.
-   * @pre Either the property name is not in use, or a property exists with the correct name & type.
-   */
-  void SetUniform( const std::string& name,
-                   Vector2 value,
-                   UniformCoordinateType uniformCoordinateType = UniformCoordinateType(COORDINATE_TYPE_DEFAULT) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Set a uniform value.
-   *
-   * This will register a property of type Property::VECTOR3; see Object::RegisterProperty() for more details.
-   * If name matches a uniform in the shader source, this value will be uploaded when rendering.
-   * @SINCE_1_0.0
-   * @param name The name of the uniform.
-   * @param value The value to to set.
-   * @param uniformCoordinateType The coordinate type of the uniform.
-   * @pre Either the property name is not in use, or a property exists with the correct name & type.
-   */
-  void SetUniform( const std::string& name,
-                   Vector3 value,
-                   UniformCoordinateType uniformCoordinateType = UniformCoordinateType(COORDINATE_TYPE_DEFAULT) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Set a uniform value.
-   *
-   * This will register a property of type Property::VECTOR4; see Object::RegisterProperty() for more details.
-   * If name matches a uniform in the shader source, this value will be uploaded when rendering.
-   * @SINCE_1_0.0
-   * @param name The name of the uniform.
-   * @param value The value to to set.
-   * @param uniformCoordinateType The coordinate type of the uniform.
-   * @pre Either the property name is not in use, or a property exists with the correct name & type.
-   */
-  void SetUniform( const std::string& name,
-                   Vector4 value,
-                   UniformCoordinateType uniformCoordinateType = UniformCoordinateType(COORDINATE_TYPE_DEFAULT) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Set a uniform value.
-   *
-   * This will register a property of type Property::MATRIX; see Object::RegisterProperty() for more details.
-   * If name matches a uniform in the shader source, this value will be uploaded when rendering.
-   * @SINCE_1_0.0
-   * @param name The name of the uniform.
-   * @param value The value to to set.
-   * @param uniformCoordinateType The coordinate type of the uniform.
-   * @pre Either the property name is not in use, or a property exists with the correct name & type.
-   */
-  void SetUniform( const std::string& name,
-                   const Matrix& value,
-                   UniformCoordinateType uniformCoordinateType = UniformCoordinateType(COORDINATE_TYPE_DEFAULT) );
-
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief Set a uniform value.
-   *
-   * This will register a property of type Property::MATRIX3; see Object::RegisterProperty() for more details.
-   * If name matches a uniform in the shader source, this value will be uploaded when rendering.
-   * @SINCE_1_0.0
-   * @param name The name of the uniform.
-   * @param value The value to to set.
-   * @param uniformCoordinateType The coordinate type of the uniform.
-   * @pre Either the property name is not in use, or a property exists with the correct name & type.
-   */
-  void SetUniform( const std::string& name,
-                   const Matrix3& value,
-                   UniformCoordinateType uniformCoordinateType = UniformCoordinateType(COORDINATE_TYPE_DEFAULT) );
-
-public: // Not intended for application developers
-
-  /// @cond internal
-  /**
-   * @DEPRECATED_1_0.47
-   * @brief This constructor is used by Dali New() methods.
-   * @SINCE_1_0.0
-   * @param [in] effect A pointer to a newly allocated Dali resource.
-   */
-  explicit DALI_INTERNAL ShaderEffect(Internal::ShaderEffect* effect);
-  /// @endcond
-};
-
-/**
- * @}
- */
-} // namespace Dali
-
-#endif // __DALI_SHADER_EFFECT_H__
index 2671743..c9a810c 100644 (file)
@@ -173,7 +173,6 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform,
   mImageFactory = new ImageFactory( *mResourceClient );
   mShaderFactory = new ShaderFactory();
   mUpdateManager->SetShaderSaver( *mShaderFactory );
-  mShaderFactory->LoadDefaultShaders();
 
   GetImplementation(Dali::TypeRegistry::Get()).CallInitFunctions();
 }
index b3fce27..ce9d371 100644 (file)
@@ -24,6 +24,7 @@
 #include <cfloat>
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/actors/layer-devel.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/events/touch-data.h>
@@ -31,6 +32,7 @@
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/radian.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/internal/common/internal-constants.h>
 #include <dali/internal/event/common/event-thread-services.h>
@@ -198,7 +200,7 @@ DALI_PROPERTY( "minimumSize",         VECTOR2,  true,  false, false, Dali::Actor
 DALI_PROPERTY( "maximumSize",         VECTOR2,  true,  false, false, Dali::Actor::Property::MAXIMUM_SIZE )
 DALI_PROPERTY( "inheritPosition",     BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_POSITION )
 DALI_PROPERTY( "clippingMode",        STRING,   true,  false, false, Dali::Actor::Property::CLIPPING_MODE )
-DALI_PROPERTY( "batchParent",         BOOLEAN,  true,  false, false, Dali::Actor::Property::BATCH_PARENT )
+DALI_PROPERTY( "batchParent",         BOOLEAN,  true,  false, false, Dali::DevelActor::Property::BATCH_PARENT )
 DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
 
 // Signals
@@ -354,6 +356,10 @@ float GetDimensionValue( const Vector3& values, Dimension::Type dimension )
   return GetDimensionValue( values.GetVectorXY(), dimension );
 }
 
+unsigned int GetDepthIndex( uint16_t depth, uint16_t siblingOrder )
+{
+  return depth * Dali::DevelLayer::TREE_DEPTH_MULTIPLIER + siblingOrder * Dali::DevelLayer::SIBLING_ORDER_MULTIPLIER;
+}
 
 } // unnamed namespace
 
@@ -1969,6 +1975,7 @@ Actor::Actor( DerivedType derivedType )
   mName(),
   mId( ++mActorCounter ), // actor ID is initialised to start from 1, and 0 is reserved
   mDepth( 0u ),
+  mSiblingOrder(0u),
   mIsRoot( ROOT_LAYER == derivedType ),
   mIsLayer( LAYER == derivedType || ROOT_LAYER == derivedType ),
   mIsOnStage( false ),
@@ -2070,6 +2077,7 @@ void Actor::RecursiveConnectToStage( ActorContainer& connectionList, unsigned in
 
   mIsOnStage = true;
   mDepth = depth;
+  SetDepthIndexMessage( GetEventThreadServices(), *mNode, GetDepthIndex( mDepth, mSiblingOrder ) );
 
   ConnectToSceneGraph();
 
@@ -2661,7 +2669,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
       break;
     }
 
-    case Dali::Actor::Property::BATCH_PARENT:
+    case Dali::DevelActor::Property::BATCH_PARENT:
     {
       bool value;
 
@@ -2676,6 +2684,24 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
       break;
     }
 
+    case Dali::DevelActor::Property::SIBLING_ORDER:
+       {
+         int value;
+
+         if( property.Get( value ) )
+         {
+           if( static_cast<unsigned int>(value) != mSiblingOrder )
+           {
+             mSiblingOrder = value;
+             if( mIsOnStage )
+             {
+               SetDepthIndexMessage( GetEventThreadServices(), *mNode, GetDepthIndex( mDepth, mSiblingOrder ) );
+             }
+           }
+         }
+         break;
+       }
+
     case Dali::Actor::Property::CLIPPING_MODE:
     {
       ClippingMode::Type convertedValue = mClippingMode;
@@ -2849,8 +2875,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
 
     default:
     {
-      DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should not come here
-      break;
+      // nothing to do for other types
     }
   } // entry.GetType
 }
@@ -3181,21 +3206,21 @@ Property::Value Actor::GetDefaultProperty( Property::Index index ) const
       break;
     }
 
-    case Dali::Actor::Property::BATCH_PARENT:
+    case Dali::DevelActor::Property::BATCH_PARENT:
     {
       value = mIsBatchParent;
       break;
     }
 
-    case Dali::Actor::Property::CLIPPING_MODE:
+    case Dali::DevelActor::Property::SIBLING_ORDER:
     {
-      value = mClippingMode;
+      value = static_cast<int>(mSiblingOrder);
       break;
     }
 
-    default:
+    case Dali::Actor::Property::CLIPPING_MODE:
     {
-      DALI_ASSERT_ALWAYS( false && "Actor Property index invalid" ); // should not come here
+      value = mClippingMode;
       break;
     }
   }
index 2b3074f..1d37366 100644 (file)
@@ -1815,7 +1815,9 @@ protected:
   std::string     mName;      ///< Name of the actor
   unsigned int    mId;        ///< A unique ID to identify the actor starting from 1, and 0 is reserved
 
-  unsigned short mDepth                            :12; ///< Cached: The depth in the hierarchy of the actor. Only 4096 levels of depth are supported
+  uint16_t mDepth;            ///< The depth in the hierarchy of the actor. Only 4096 levels of depth are supported
+  uint16_t mSiblingOrder;     ///< The sibling order of the actor
+
   const bool mIsRoot                               : 1; ///< Flag to identify the root actor
   const bool mIsLayer                              : 1; ///< Flag to identify that this is a layer
   bool mIsOnStage                                  : 1; ///< Flag to identify whether the actor is on-stage
index 5a8ca0c..ec1a6ca 100644 (file)
@@ -36,7 +36,6 @@
 #include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
 #include <dali/internal/update/manager/update-manager.h>
 
 using Dali::Internal::SceneGraph::UpdateManager;
@@ -341,11 +340,14 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Time
 
 void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period)
 {
-  Object& object = dynamic_cast<Object&>( GetImplementation(target.object) );
+  Object& object = GetImplementation( target.object );
+  const Property::Type targetType = object.GetPropertyType( target.propertyIndex );
+  const Property::Type destinationType = relativeValue.GetType();
+  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
 
   ExtendDuration( period );
 
-  switch ( relativeValue.GetType() )
+  switch ( targetType )
   {
     case Property::BOOLEAN:
     {
@@ -427,8 +429,9 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
     }
 
     default:
-      DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should never come here
-      break;
+    {
+      // non animatable types handled already
+    }
   }
 }
 
@@ -449,28 +452,29 @@ void Animation::AnimateTo(Property& target, Property::Value& destinationValue, T
 
 void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
 {
-  Object& object = dynamic_cast<Object&>( GetImplementation(target.object) );
+  Object& object = GetImplementation(target.object);
 
   AnimateTo( object, target.propertyIndex, target.componentIndex, destinationValue, alpha, period );
 }
 
 void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
 {
-  Property::Type type = targetObject.GetPropertyType(targetPropertyIndex);
-  if(componentIndex != Property::INVALID_COMPONENT_INDEX)
+  Property::Type targetType = targetObject.GetPropertyType(targetPropertyIndex);
+  if( componentIndex != Property::INVALID_COMPONENT_INDEX )
   {
-    if( type == Property::VECTOR2
-        || type == Property::VECTOR3
-        || type == Property::VECTOR4 )
+    if( ( targetType == Property::VECTOR2 ) ||
+        ( targetType == Property::VECTOR3 ) ||
+        ( targetType == Property::VECTOR4 ) )
     {
-      type = Property::FLOAT;
+      targetType = Property::FLOAT;
     }
   }
-  DALI_ASSERT_ALWAYS( type == destinationValue.GetType() && "DestinationValue does not match Target Property type" );
+  const Property::Type destinationType = destinationValue.GetType();
+  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
 
   ExtendDuration( period );
 
-  switch (destinationValue.GetType())
+  switch ( destinationType )
   {
     case Property::BOOLEAN:
     {
@@ -596,8 +600,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
     }
 
     default:
-      DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should never come here
-      break;
+    {
+      // non animatable types handled already
+    }
   }
 }
 
@@ -638,7 +643,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
 void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
 {
-  Object& object = dynamic_cast<Object&>( GetImplementation(target.object) );
+  Object& object = GetImplementation( target.object );
 
   ExtendDuration( period );
 
@@ -742,8 +747,10 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       break;
     }
 
-    default: // not all property types are animateable
-      break;
+    default:
+    {
+      // non animatable types handled by keyframes
+    }
   }
 }
 
index 4e0c3ed..031495e 100644 (file)
@@ -82,7 +82,7 @@ void KeyFrames::CreateKeyFramesSpec(Property::Type type)
     }
     default:
     {
-      DALI_ASSERT_DEBUG(!"Type not supported");
+      DALI_ABORT( "Type not animateable" );
       break;
     }
   }
index 7de8d3c..46f221f 100644 (file)
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/math/angle-axis.h>
+#include <dali/public-api/math/degree.h>
 #include <dali/public-api/math/quaternion.h>
-#include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/radian.h>
-#include <dali/public-api/math/degree.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
 
 namespace Dali
 {
@@ -62,29 +65,29 @@ public:
   T mValue;          ///< value this animation channel should take
 };
 
-typedef ProgressValue<Quaternion>                       ProgressQuaternion;
-typedef std::vector<ProgressQuaternion>                 ProgressQuaternionContainer;
+typedef ProgressValue<Quaternion>                  ProgressQuaternion;
+typedef Vector<ProgressQuaternion>                 ProgressQuaternionContainer;
 
-typedef ProgressValue<AngleAxis>                        ProgressAngleAxis;
-typedef std::vector<AngleAxis>                          ProgressAngleAxisContainer;
+typedef ProgressValue<AngleAxis>                   ProgressAngleAxis;
+typedef Vector<AngleAxis>                          ProgressAngleAxisContainer;
 
-typedef ProgressValue<bool>                             ProgressBoolean;
-typedef std::vector<ProgressBoolean>                    ProgressBooleanContainer;
+typedef ProgressValue<bool>                        ProgressBoolean;
+typedef Vector<ProgressBoolean>                    ProgressBooleanContainer;
 
-typedef ProgressValue<int>                              ProgressInteger;
-typedef std::vector<ProgressInteger>                    ProgressIntegerContainer;
+typedef ProgressValue<int>                         ProgressInteger;
+typedef Vector<ProgressInteger>                    ProgressIntegerContainer;
 
-typedef ProgressValue<float>                            ProgressNumber;
-typedef std::vector<ProgressNumber>                     ProgressNumberContainer;
+typedef ProgressValue<float>                       ProgressNumber;
+typedef Vector<ProgressNumber>                     ProgressNumberContainer;
 
-typedef ProgressValue<Vector2>                          ProgressVector2;
-typedef std::vector<ProgressVector2>                    ProgressVector2Container;
+typedef ProgressValue<Vector2>                     ProgressVector2;
+typedef Vector<ProgressVector2>                    ProgressVector2Container;
 
-typedef ProgressValue<Vector3>                          ProgressVector3;
-typedef std::vector<ProgressVector3>                    ProgressVector3Container;
+typedef ProgressValue<Vector3>                     ProgressVector3;
+typedef Vector<ProgressVector3>                    ProgressVector3Container;
 
-typedef ProgressValue<Vector4>                          ProgressVector4;
-typedef std::vector<ProgressVector4>                    ProgressVector4Container;
+typedef ProgressValue<Vector4>                     ProgressVector4;
+typedef Vector<ProgressVector4>                    ProgressVector4Container;
 
 inline void Interpolate (Quaternion& result, const Quaternion& a, const Quaternion& b, float progress)
 {
index 30d58fc..595baee 100644 (file)
@@ -296,18 +296,10 @@ struct ObjectImplHelper
 
       default:
       {
-        DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should not come here
-        break;
+        // ignore non-scene-graph types
       }
     }
   }
-
-  int GetPropertyComponentIndex( Property::Index index ) const
-  {
-    // TODO: MESH_REWORK
-    DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
-    return 0;
-  }
 };
 
 
index f150c35..92a889f 100644 (file)
@@ -796,7 +796,7 @@ Dali::PropertyNotification Object::AddPropertyNotification(Property::Index index
   {
     if ( index <= PROPERTY_REGISTRATION_MAX_INDEX )
     {
-      DALI_ASSERT_ALWAYS( false && "Property notification added to event side only property." );
+      DALI_ABORT( "Property notification added to event side only property." );
     }
     else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
     {
@@ -1083,8 +1083,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const
 
       default:
       {
-        DALI_ASSERT_ALWAYS( false && "PropertyType enumeration is out of bounds" );
-        break;
+        // unreachable code due to higher level logic
       }
     } // switch(type)
   } // if animatable
index 70c5edc..9c3c438 100644 (file)
@@ -56,14 +56,6 @@ unsigned int GetPropertyImplementationAlignment( Property::Type& propertyType )
 
   switch( propertyType )
   {
-    case Property::NONE:
-    case Property::STRING:
-    case Property::ARRAY:
-    case Property::MAP:
-    {
-      DALI_ASSERT_ALWAYS( false && "No size for properties with no type, or dynamic sizes" );
-      break;
-    }
     case Property::BOOLEAN:
     {
       alignment = PropertyImplementationTypeAlignment< Property::BOOLEAN >::VALUE;
@@ -114,6 +106,13 @@ unsigned int GetPropertyImplementationAlignment( Property::Type& propertyType )
       alignment = PropertyImplementationTypeAlignment< Property::ROTATION >::VALUE;
       break;
     }
+    case Property::NONE:
+    case Property::STRING:
+    case Property::ARRAY:
+    case Property::MAP:
+    {
+      // already handled by higher level code
+    }
   }
 
   return alignment;
@@ -208,6 +207,13 @@ void PropertyBuffer::Initialize( Dali::Property::Map& formatMap )
     Property::Type type = Property::Type( component.second.Get<int>() );
 
     // Get the size and alignment
+    if( ( type == Property::NONE   ) ||
+        ( type == Property::STRING ) ||
+        ( type == Property::ARRAY  ) ||
+        ( type == Property::MAP    ) )
+    {
+      DALI_ABORT( "Property::Type not supported in PropertyBuffer" );
+    }
     unsigned int elementSize = GetPropertyImplementationSize( type );
     unsigned int elementAlignment = GetPropertyImplementationAlignment( type );
 
@@ -258,14 +264,6 @@ unsigned int GetPropertyImplementationSize( Property::Type& propertyType )
 
   switch( propertyType )
   {
-    case Property::NONE:
-    case Property::STRING:
-    case Property::ARRAY:
-    case Property::MAP:
-    {
-      DALI_ASSERT_ALWAYS( "No size for properties with no type, or dynamic sizes" );
-      break;
-    }
     case Property::BOOLEAN:
     {
       size = sizeof( PropertyImplementationType< Property::BOOLEAN >::Type );
@@ -316,6 +314,13 @@ unsigned int GetPropertyImplementationSize( Property::Type& propertyType )
       size = sizeof( PropertyImplementationType< Property::ROTATION >::Type );
       break;
     }
+    case Property::NONE:
+    case Property::STRING:
+    case Property::ARRAY:
+    case Property::MAP:
+    {
+      // already handled by higher level code
+    }
   }
 
   return size;
index ff4604d..8a700ca 100644 (file)
@@ -78,8 +78,7 @@ public:
    */
   virtual const bool& GetBoolean( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const bool&>(*this);
   }
 
@@ -91,8 +90,7 @@ public:
    */
   virtual const int& GetInteger( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const int&>(*this);
   }
 
@@ -104,8 +102,7 @@ public:
    */
   virtual const float& GetFloat( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const float&>(*this);
   }
 
@@ -117,8 +114,7 @@ public:
    */
   virtual const Vector2& GetVector2( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const Vector2&>(*this);
   }
 
@@ -130,8 +126,7 @@ public:
    */
   virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const Vector3&>(*this);
   }
 
@@ -143,8 +138,7 @@ public:
    */
   virtual const Vector4& GetVector4( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const Vector4&>(*this);
   }
 
@@ -156,8 +150,7 @@ public:
    */
   virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const Quaternion&>(*this);
   }
 
@@ -169,8 +162,7 @@ public:
    */
   virtual const Matrix3& GetMatrix3( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const Matrix3&>(*this);
   }
 
@@ -182,8 +174,7 @@ public:
    */
   virtual const Matrix& GetMatrix( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
-    // the return will never be executed due to assert above so just keep the compiler happy
+    // the return will never be executed, it's just to keep the compiler happy
     return reinterpret_cast<const Matrix&>(*this);
   }
 
index b0af410..c52ede9 100644 (file)
@@ -25,6 +25,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/object/property.h>
+#include <dali/public-api/object/property-value.h>
 
 namespace Dali
 {
index 479f2e8..2c7301e 100644 (file)
@@ -106,7 +106,14 @@ namespace Internal
 {
 
 TypeInfo::TypeInfo(const std::string &name, const std::string &baseTypeName, Dali::TypeInfo::CreateFunction creator)
-  : mTypeName(name), mBaseTypeName(baseTypeName), mCreate(creator)
+  : mTypeName(name), mBaseTypeName(baseTypeName), mCSharpType(false), mCreate(creator)
+{
+  DALI_ASSERT_ALWAYS(!name.empty() && "Type info construction must have a name");
+  DALI_ASSERT_ALWAYS(!baseTypeName.empty() && "Type info construction must have a base type name");
+}
+
+TypeInfo::TypeInfo(const std::string &name, const std::string &baseTypeName, Dali::CSharpTypeInfo::CreateFunction creator)
+  : mTypeName(name), mBaseTypeName(baseTypeName), mCSharpType(true), mCSharpCreate(creator)
 {
   DALI_ASSERT_ALWAYS(!name.empty() && "Type info construction must have a name");
   DALI_ASSERT_ALWAYS(!baseTypeName.empty() && "Type info construction must have a base type name");
@@ -122,7 +129,14 @@ BaseHandle TypeInfo::CreateInstance() const
 
   if(mCreate)
   {
-    ret = mCreate();
+    if ( mCSharpType )
+    {
+      ret = *mCSharpCreate();
+    }
+    else
+    {
+      ret = mCreate();
+    }
 
     if ( ret )
     {
@@ -400,6 +414,33 @@ void TypeInfo::AddProperty( const std::string& name, Property::Index index, Prop
   }
 }
 
+void TypeInfo::AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc)
+{
+
+  // The setter can be empty as a property can be read-only.
+
+  if ( NULL == getFunc )
+  {
+    DALI_ASSERT_ALWAYS( ! "GetProperty Function is empty" );
+  }
+  else
+  {
+    RegisteredPropertyContainer::iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                          PairFinder< Property::Index, RegisteredPropertyPair>(index) );
+
+    if ( iter == mRegisteredProperties.end() )
+    {
+      mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, setFunc, getFunc, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+    }
+    else
+    {
+      DALI_ASSERT_ALWAYS( ! "Property index already added to Type" );
+    }
+  }
+
+}
+
+
 void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index index, Property::Type type )
 {
   RegisteredPropertyContainer::iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
@@ -407,7 +448,7 @@ void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index i
 
   if ( iter == mRegisteredProperties.end() )
   {
-    mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, NULL, NULL, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+    mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
   }
   else
   {
@@ -422,7 +463,7 @@ void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index i
 
   if ( iter == mRegisteredProperties.end() )
   {
-    mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( defaultValue.GetType(), NULL, NULL, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+    mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( defaultValue.GetType(), name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
     mPropertyDefaultValues.push_back( PropertyDefaultValuePair( index, defaultValue ) );
   }
   else
@@ -448,7 +489,7 @@ void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property
 
     if ( iter == mRegisteredProperties.end() )
     {
-      mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, NULL, NULL, name, baseIndex, componentIndex ) ) );
+      mRegisteredProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, name, baseIndex, componentIndex ) ) );
       success = true;
     }
   }
@@ -463,7 +504,7 @@ void TypeInfo::AddChildProperty( const std::string& name, Property::Index index,
 
   if ( iter == mRegisteredChildProperties.end() )
   {
-    mRegisteredChildProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, NULL, NULL, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
+    mRegisteredChildProperties.push_back( RegisteredPropertyPair( index, RegisteredProperty( type, name, Property::INVALID_INDEX, Property::INVALID_COMPONENT_INDEX ) ) );
   }
   else
   {
@@ -755,8 +796,19 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, Property::Index
                                                           PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
   if( iter != mRegisteredProperties.end() )
   {
-    // Need to remove the constness here as CustomActor will not be able to call Downcast with a const pointer to the object
-    return iter->second.getFunc( const_cast< BaseObject* >( object ), index );
+    if( mCSharpType ) // using csharp property get which returns a pointer to a Property::Value
+    {
+       // CSharp can't return any object by value, it can return pointers.
+       // CSharp has ownership of the pointer contents, which is fine because we are returning by value
+       int index = (iter->first );
+       return *( iter->second.cSharpGetFunc( const_cast< BaseObject* >( object ), &index  ));
+
+    }
+    else
+    {
+      // Need to remove the constness here as CustomActor will not be able to call Downcast with a const pointer to the object
+      return iter->second.getFunc( const_cast< BaseObject* >( object ), index );
+    }
   }
 
   Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
@@ -774,8 +826,19 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, const std::stri
                                                           PropertyNameFinder< RegisteredPropertyPair >( name ) );
   if( iter != mRegisteredProperties.end() )
   {
-    // Need to remove the constness here as CustomActor will not be able to call Downcast with a const pointer to the object
-    return iter->second.getFunc( const_cast< BaseObject* >( object ), iter->first );
+    if( mCSharpType ) // using csharp property get which returns a pointer to a Property::Value
+    {
+      // CSharp can't return any object by value, it can return pointers.
+      // CSharp has ownership of the pointer contents, which is fine because we are returning by value
+      int index = (iter->first );
+      return *( iter->second.cSharpGetFunc( const_cast< BaseObject* >( object ), &index ));
+
+    }
+    else
+    {
+      // Need to remove the constness here as CustomActor will not be able to call Downcast with a const pointer to the object
+      return iter->second.getFunc( const_cast< BaseObject* >( object ), iter->first );
+    }
   }
 
   Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
index f397736..325f4f6 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/type-info.h>
+#include <dali/devel-api/object/csharp-type-info.h>
 
 namespace Dali
 {
@@ -48,7 +49,15 @@ public:
    * @param [baseName] the base type registered name
    * @param [creator] the creator function for this type
    */
-  TypeInfo(const std::string &name, const std::string &baseName, Dali::TypeInfo::CreateFunction creator);
+  TypeInfo(const std::string& name, const std::string& baseName, Dali::TypeInfo::CreateFunction creator);
+
+  /**
+   * Create TypeInfo for a csharp object
+   * @param [name] the registered name
+   * @param [baseName] the base type registered name
+   * @param [creator] the creator function for this type
+   */
+  TypeInfo(const std::string& name, const std::string& baseName, Dali::CSharpTypeInfo::CreateFunction creator);
 
   /**
    *
@@ -139,6 +148,16 @@ public:
   void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc );
 
   /**
+   * Adds an event-thread only property to the type.
+   * @param[in] name The name of the property.
+   * @param[in] index The index of the property.
+   * @param[in] type The Property::Type.
+   * @param[in] setFunc The function to call to set the property (Can be NULL).
+   * @param[in] getFunc The function to call to retrieve the value of the property.
+   */
+  void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc);
+
+  /**
    * Adds an animatable property to the type.
    * @param[in] name The name of the property.
    * @param[in] index The index of the property
@@ -301,6 +320,17 @@ private:
     {
     }
 
+    RegisteredProperty( Property::Type propType, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
+        : type( propType ),
+          setFunc( NULL ),
+          getFunc( NULL ),
+          name( propName ),
+          basePropertyIndex(basePropertyIndex),
+          componentIndex(componentIndex)
+    {
+    }
+
+
     RegisteredProperty( Property::Type propType, Dali::TypeInfo::SetPropertyFunction set, Dali::TypeInfo::GetPropertyFunction get, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
     : type( propType ),
       setFunc( set ),
@@ -311,9 +341,28 @@ private:
     {
     }
 
+    RegisteredProperty( Property::Type propType, Dali::CSharpTypeInfo::SetPropertyFunction set, Dali::CSharpTypeInfo::GetPropertyFunction get, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
+    : type( propType ),
+      cSharpSetFunc( set ),
+      cSharpGetFunc( get ),
+      name( propName ),
+      basePropertyIndex(basePropertyIndex),
+      componentIndex(componentIndex)
+    {
+    }
+
+
     Property::Type type;
-    Dali::TypeInfo::SetPropertyFunction setFunc;
-    Dali::TypeInfo::GetPropertyFunction getFunc;
+    union
+    {
+      Dali::TypeInfo::SetPropertyFunction setFunc;
+      Dali::CSharpTypeInfo::SetPropertyFunction cSharpSetFunc;
+    };
+    union
+    {
+      Dali::TypeInfo::GetPropertyFunction getFunc;
+      Dali::CSharpTypeInfo::GetPropertyFunction cSharpGetFunc;
+    };
     std::string name;
     Property::Index basePropertyIndex;
     int componentIndex;
@@ -331,7 +380,12 @@ private:
 
   std::string mTypeName;
   std::string mBaseTypeName;
-  Dali::TypeInfo::CreateFunction mCreate;
+  bool        mCSharpType:1;    ///< Whether this type info is for a CSharp control (instead of C++)
+  union
+  {
+    Dali::TypeInfo::CreateFunction mCreate;
+    Dali::CSharpTypeInfo::CreateFunction mCSharpCreate;
+  };
   ActionContainer mActions;
   ConnectorContainer mSignalConnectors;
   RegisteredPropertyContainer mRegisteredProperties;
index 7a8c74e..dd947a2 100644 (file)
@@ -157,12 +157,45 @@ bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_
   return ret;
 }
 
+bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
+    Dali::CSharpTypeInfo::CreateFunction createInstance, bool callCreateOnInit  )
+{
+
+  bool ret = false;
+
+  std::string baseTypeName    = DemangleClassName(baseTypeInfo.name());
+
+  RegistryMap::iterator iter = mRegistryLut.find(uniqueTypeName);
+
+  if( iter == mRegistryLut.end() )
+  {
+    mRegistryLut[uniqueTypeName] = Dali::TypeInfo(new Internal::TypeInfo(uniqueTypeName, baseTypeName, createInstance));
+    ret = true;
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "Type Registration %s(%s)\n", uniqueTypeName.c_str(), baseTypeName.c_str());
+  }
+  else
+  {
+    DALI_LOG_WARNING("Duplicate name for TypeRegistry for '%s'\n", + uniqueTypeName.c_str());
+    DALI_ASSERT_ALWAYS(!"Duplicate type name for Type Registation");
+  }
+  if( callCreateOnInit )
+  {
+    mCSharpInitFunctions.push_back(createInstance);
+  }
+  return ret;
+
+}
+
 void TypeRegistry::CallInitFunctions(void) const
 {
   for( InitFunctions::const_iterator iter = mInitFunctions.begin(); iter != mInitFunctions.end(); ++iter)
   {
     (*iter)();
   }
+  for( CSharpInitFunctions::const_iterator iter = mCSharpInitFunctions.begin(); iter != mCSharpInitFunctions.end(); ++iter)
+  {
+    (*iter)();
+  }
 }
 
 std::string TypeRegistry::RegistrationName( const std::type_info& registerType )
@@ -216,6 +249,24 @@ bool TypeRegistry::RegisterProperty( TypeRegistration& registered, const std::st
   return false;
 }
 
+bool TypeRegistry::RegisterProperty( const std::string& objectName, const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc )
+{
+  RegistryMap::iterator iter = mRegistryLut.find( objectName );
+
+  if( iter != mRegistryLut.end() )
+  {
+    DALI_ASSERT_DEBUG(iter->second);
+
+    GetImplementation(iter->second).AddProperty( name, index, type, setFunc, getFunc );
+
+    return true;
+  }
+
+  return false;
+
+}
+
+
 bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type )
 {
   RegistryMap::iterator iter = mRegistryLut.find( registered.RegisteredName() );
index 71c9675..815d0da 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/common/map-wrapper.h>
+#include <dali/devel-api/object/csharp-type-info.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/base-object.h>
@@ -88,6 +89,17 @@ public:
                  Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit  );
 
   /*
+   * Register a creation function under a unique name (used by C# Custom controls).
+   * @param [in] name The name type to be registered (must be unique)
+   * @param [in] baseTypeInfo Type info for its base class
+   * @param [in] createInstance Instance creation function
+   * @param [in] callCreateOnInit If true call createInstance on dali initialisation
+   * @return true if the name could be registered.
+   */
+  bool Register( const std::string& name, const std::type_info& baseTypeInfo,
+                 Dali::CSharpTypeInfo::CreateFunction createInstance, bool callCreateOnInit );
+
+  /*
    * Register a signal connector function to a type
    * @param [in] typeRegistration TypeRegistration object used to register the type
    * @param [in] name Signal name
@@ -117,6 +129,19 @@ public:
   bool RegisterProperty( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc );
 
   /**
+   * Register an event-thread only property with a type (used by C# Custom controls)
+   * @param [in] objectName name of the object used to register the type
+   * @param [in] name Property name
+   * @param [in] index Property index
+   * @param [in] type Property type
+   * @param [in] setFunc The function to set the property (Can be NULL).
+   * @param [in] getFunc The function to get the value of a property.
+   * @return true if registered
+   */
+  bool RegisterProperty( const std::string& objectName, const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc );
+
+
+  /**
    * Register a scene graph only property with a type
    * @param [in] registered TypeRegistration object used to register the type
    * @param [in] name Property name
@@ -199,6 +224,9 @@ private:
   typedef std::vector<Dali::TypeInfo::CreateFunction> InitFunctions;
   InitFunctions mInitFunctions;
 
+  typedef std::vector<Dali::CSharpTypeInfo::CreateFunction> CSharpInitFunctions;
+  CSharpInitFunctions mCSharpInitFunctions;
+
 private:
   TypeRegistry();
   ~TypeRegistry();
diff --git a/dali/internal/event/effects/shader-declarations.h b/dali/internal/event/effects/shader-declarations.h
deleted file mode 100644 (file)
index 0203922..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __DALI_INTERNAL_SHADER_DECLARATIONS_H__
-#define __DALI_INTERNAL_SHADER_DECLARATIONS_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// INTERNAL HEADERS
-#include <dali/public-api/object/ref-object.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class ShaderEffect;
-typedef IntrusivePtr<ShaderEffect> ShaderEffectPtr;
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_SHADER_DECLARATIONS_H__
diff --git a/dali/internal/event/effects/shader-effect-impl.cpp b/dali/internal/event/effects/shader-effect-impl.cpp
deleted file mode 100644 (file)
index cd76e36..0000000
+++ /dev/null
@@ -1,596 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/effects/shader-effect-impl.h>
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strcmp
-
-// INTERNAL INCLUDES
-#include <dali/public-api/math/matrix.h>
-#include <dali/public-api/math/matrix3.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/scripting/scripting.h>
-#include <dali/devel-api/shader-effects/shader-effect.h>
-#include <dali/internal/event/common/property-helper.h>
-#include <dali/internal/event/images/image-impl.h>
-#include "dali-shaders.h"
-
-using std::string;
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-// Properties
-
-//              Name             Type   writable animatable constraint-input  enum for index-checking
-DALI_PROPERTY_TABLE_BEGIN
-DALI_PROPERTY( "gridDensity",    FLOAT,   true,    false,   false,   Dali::ShaderEffect::Property::GRID_DENSITY   )
-DALI_PROPERTY( "image",          MAP,     true,    false,   false,   Dali::ShaderEffect::Property::IMAGE          )
-DALI_PROPERTY( "program",        MAP,     true,    false,   false,   Dali::ShaderEffect::Property::PROGRAM        )
-DALI_PROPERTY( "geometryHints",  STRING,  true,    false,   false,   Dali::ShaderEffect::Property::GEOMETRY_HINTS )
-DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
-
-BaseHandle Create()
-{
-  Internal::ShaderEffectPtr internal = Internal::ShaderEffect::New();
-
-  return Dali::ShaderEffect(internal.Get());
-}
-
-TypeRegistration mType( typeid(Dali::ShaderEffect), typeid(Dali::Handle), Create );
-
-struct WrapperStrings
-{
-  const char* vertexShaderPrefix;
-  const char* fragmentShaderPrefix;
-  const char* vertexShaderPostfix;
-  const char* fragmentShaderPostfix;
-};
-
-WrapperStrings customImageShaderWrappers =
-{
-  CustomImagePrefixVertex, CustomImagePrefixFragment,
-  CustomImagePostfixVertex, CustomImagePostfixFragment
-};
-
-/**
- * Helper to wrap the program with our default pre and postfix if needed
- * @param[in] vertexPrefix from application
- * @param[in] vertexBody from application
- */
-std::string WrapVertexShader( const std::string& vertexPrefix, const std::string& vertexBody )
-{
-  std::string vertexSource = vertexPrefix + customImageShaderWrappers.vertexShaderPrefix;
-
-  // Append the custom vertex shader code if supplied, otherwise append the default
-  if ( vertexBody.length() > 0 )
-  {
-    vertexSource.append( vertexBody );
-  }
-  else
-  {
-    vertexSource.append( customImageShaderWrappers.vertexShaderPostfix );
-  }
-
-  return vertexSource;
-}
-
-/**
- * Helper to wrap the program with our default pre and postfix if needed
- * @param[in] fragmentPrefix from application
- * @param[in] fragmentBody from application
- */
-std::string WrapFragmentShader( const std::string& fragmentPrefix, const std::string& fragmentBody )
-{
-  std::string fragmentSource = fragmentPrefix + customImageShaderWrappers.fragmentShaderPrefix;
-
-  // Append the custom fragment shader code if supplied, otherwise append the default
-  if ( fragmentBody.length() > 0 )
-  {
-    fragmentSource.append( fragmentBody );
-  }
-  else
-  {
-    fragmentSource.append( customImageShaderWrappers.fragmentShaderPostfix );
-  }
-
-  return fragmentSource;
-}
-
-std::string GetStringProperty(const std::string& field, const Property::Value& property)
-{
-  std::string retval;
-  const Property::Map* map = property.GetMap();
-  if( map )
-  {
-    const Property::Value* value = map->Find( field );
-    if( value )
-    {
-      value->Get( retval );
-    }
-  }
-
-  return retval;
-}
-
-Dali::Shader::Hint::Value ConvertHints( Dali::ShaderEffect::GeometryHints hints)
-{
-  int convertedHints = Dali::Shader::Hint::NONE;
-
-  if( hints & Dali::ShaderEffect::HINT_BLENDING )
-  {
-    convertedHints |= Dali::Shader::Hint::OUTPUT_IS_TRANSPARENT;
-  }
-  if( !(hints & Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY) )
-  {
-    convertedHints |= Dali::Shader::Hint::MODIFIES_GEOMETRY;
-  }
-
-  return Dali::Shader::Hint::Value( convertedHints );
-}
-
-} // unnamed namespace
-
-ShaderEffectPtr ShaderEffect::New( Dali::ShaderEffect::GeometryHints hints )
-{
-  ShaderEffectPtr shaderEffect( new ShaderEffect( hints ) );
-  shaderEffect->RegisterObject();
-  return shaderEffect;
-}
-
-ShaderEffect::ShaderEffect( Dali::ShaderEffect::GeometryHints hints )
-: mGridDensity( Dali::ShaderEffect::DEFAULT_GRID_DENSITY ),
-  mGeometryHints( hints )
-{
-}
-
-ShaderEffect::~ShaderEffect()
-{
-  // Guard to allow handle destruction after Core has been destroyed
-  UnregisterObject();
-}
-
-void ShaderEffect::SetEffectImage( Dali::Image image )
-{
-  // if images are the same, do nothing
-  if ( mEffectImage == image )
-  {
-    return;
-  }
-
-  if ( mEffectImage && mConnectedActors.size() > 0 )
-  {
-    // unset previous image
-    GetImplementation( mEffectImage ).Disconnect();
-  }
-
-  // in case image is empty this will reset our image handle
-  mEffectImage = image;
-
-  if( image )
-  {
-    // tell image that we're using it
-    if (mConnectedActors.size() > 0)
-    {
-      GetImplementation( mEffectImage ).Connect();
-    }
-  }
-
-  //inform connected actors the image has been unset
-  // TODO or CHECK: ImageActor part was removed.
-}
-
-void ShaderEffect::SetUniform( const std::string& name, Property::Value value, UniformCoordinateType uniformCoordinateType )
-{
-  // Register the property if it does not exist
-  mShader->RegisterProperty( name, value );
-}
-
-void ShaderEffect::SetPrograms( const string& vertexSource, const string& fragmentSource )
-{
-  SetPrograms( "", "", vertexSource, fragmentSource );
-}
-
-void ShaderEffect::SetPrograms( const std::string& vertexPrefix, const std::string& fragmentPrefix,
-                                const std::string& vertexSource, const std::string& fragmentSource )
-{
-  mShader = Shader::New( WrapVertexShader( vertexPrefix, vertexSource ),
-                         WrapFragmentShader( fragmentPrefix, fragmentSource ),
-                         ConvertHints( mGeometryHints ) );
-}
-
-Vector2 ShaderEffect::GetGridSize( const Vector2& size )
-{
-  Vector2 gridSize( 1.f, 1.f );
-
-  if( mGridDensity > 0 )
-  {
-    if( ( mGeometryHints & Dali::ShaderEffect::HINT_GRID_X ) )
-    {
-      gridSize.x = ceil( size.width / mGridDensity );
-    }
-    if( ( mGeometryHints & Dali::ShaderEffect::HINT_GRID_Y ) )
-    {
-      gridSize.y = ceil( size.height / mGridDensity );
-    }
-  }
-
-  return gridSize;
-}
-
-void ShaderEffect::Connect( ActorPtr actor )
-{
-  if( !actor )
-  {
-    return;
-  }
-
-  std::vector< ActorPtr >::const_iterator it = std::find( mConnectedActors.begin(), mConnectedActors.end(), actor );
-  if( it == mConnectedActors.end() )
-  {
-    mConnectedActors.push_back( actor );
-  }
-
-  if( mEffectImage && mConnectedActors.size() == 1 )
-  {
-    GetImplementation( mEffectImage ).Connect();
-  }
-}
-void ShaderEffect::Disconnect( ActorPtr actor )
-{
-  if( !actor )
-  {
-    return;
-  }
-
-  DALI_ASSERT_DEBUG(mConnectedActors.size() > 0);
-  std::vector< ActorPtr >::iterator match( std::remove( mConnectedActors.begin(), mConnectedActors.end(), actor ) );
-  mConnectedActors.erase( match, mConnectedActors.end() );
-
-  if (mEffectImage && mConnectedActors.size() == 0)
-  {
-     GetImplementation(mEffectImage).Disconnect();
-  }
-}
-
-unsigned int ShaderEffect::GetPropertyCount() const
-{
-  return GetDefaultPropertyCount() + mShader->GetPropertyCount();
-}
-
-std::string ShaderEffect::GetPropertyName( Property::Index index ) const
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return GetDefaultPropertyName( index );
-  }
-  else
-  {
-    return mShader->GetPropertyName( index );
-  }
-}
-
-Property::Index ShaderEffect::GetPropertyIndex( const std::string& name ) const
-{
-  Property::Index index = GetDefaultPropertyIndex( name );
-  if( index == Property::INVALID_INDEX )
-  {
-    return mShader->GetPropertyIndex( name );
-  }
-  else
-  {
-    return index;
-  }
-}
-
-bool ShaderEffect::IsPropertyWritable( Property::Index index ) const
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return IsDefaultPropertyWritable( index );
-  }
-  else
-  {
-    return mShader->IsPropertyWritable( index );
-  }
-}
-
-bool ShaderEffect::IsPropertyAnimatable( Property::Index index ) const
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return IsDefaultPropertyAnimatable( index );
-  }
-  else
-  {
-    return mShader->IsPropertyAnimatable( index );
-  }
-}
-
-bool ShaderEffect::IsPropertyAConstraintInput( Property::Index index ) const
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return IsDefaultPropertyAConstraintInput( index );
-  }
-  else
-  {
-    return mShader->IsPropertyAConstraintInput( index );
-  }
-}
-
-Property::Type ShaderEffect::GetPropertyType( Property::Index index ) const
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return GetDefaultPropertyType( index );
-  }
-  return mShader->GetPropertyType( index );
-}
-
-void ShaderEffect::SetProperty( Property::Index index, const Property::Value& propertyValue )
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    SetDefaultProperty( index, propertyValue );
-  }
-  else
-  {
-    mShader->SetProperty( index, propertyValue );
-  }
-}
-
-Property::Value ShaderEffect::GetProperty( Property::Index index ) const
-{
-  if ( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return GetDefaultProperty( index );
-  }
-  return mShader->GetProperty( index );
-}
-
-void ShaderEffect::GetPropertyIndices( Property::IndexContainer& indices ) const
-{
-  mShader->GetPropertyIndices( indices );
-  GetDefaultPropertyIndices( indices );
-}
-
-Property::Index ShaderEffect::RegisterProperty( const std::string& name, const Property::Value& propertyValue )
-{
-  return mShader->RegisterProperty( name, propertyValue );
-}
-
-Property::Index ShaderEffect::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode )
-{
-  return mShader->RegisterProperty( name, propertyValue, accessMode );
-}
-
-Dali::PropertyNotification ShaderEffect::AddPropertyNotification( Property::Index index,
-                                                                  int componentIndex,
-                                                                  const Dali::PropertyCondition& condition )
-{
-  return mShader->AddPropertyNotification( index, componentIndex, condition );
-}
-
-void ShaderEffect::RemovePropertyNotification( Dali::PropertyNotification propertyNotification )
-{
-  mShader->RemovePropertyNotification( propertyNotification );
-}
-
-void ShaderEffect::RemovePropertyNotifications()
-{
-  mShader->RemovePropertyNotifications();
-}
-
-unsigned int ShaderEffect::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void ShaderEffect::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
-
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    indices.PushBack( i );
-  }
-}
-
-const char* ShaderEffect::GetDefaultPropertyName(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].name;
-  }
-
-  return NULL;
-}
-
-Property::Index ShaderEffect::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
-    {
-      index = i;
-      break;
-    }
-  }
-
-  return index;
-}
-
-bool ShaderEffect::IsDefaultPropertyWritable(Property::Index index) const
-{
-  return DEFAULT_PROPERTY_DETAILS[ index ].writable;
-}
-
-bool ShaderEffect::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
-}
-
-bool ShaderEffect::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
-}
-
-Property::Type ShaderEffect::GetDefaultPropertyType(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].type;
-  }
-
-  // index out of range...return Property::NONE
-  return Property::NONE;
-}
-
-void ShaderEffect::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
-{
-  switch ( index )
-  {
-    case Dali::ShaderEffect::Property::GRID_DENSITY:
-    {
-      propertyValue.Get( mGridDensity );
-      if( ( mGeometryHints & Dali::ShaderEffect::HINT_GRID_X ) ||
-          ( mGeometryHints & Dali::ShaderEffect::HINT_GRID_Y ) )
-      {
-        //inform all the connected actors
-        for(std::vector< ActorPtr >::iterator it = mConnectedActors.begin(); it != mConnectedActors.end(); ++it )
-        {
-          (*it)->RelayoutRequest();
-        }
-      }
-      break;
-    }
-
-    case Dali::ShaderEffect::Property::IMAGE:
-    {
-      Dali::Image img(Scripting::NewImage( propertyValue ));
-      if(img)
-      {
-        SetEffectImage( img );
-      }
-      else
-      {
-        DALI_LOG_WARNING("Cannot create image from property value for ShaderEffect image\n");
-      }
-      break;
-    }
-
-    case Dali::ShaderEffect::Property::PROGRAM:
-    {
-      std::string vertexPrefix   = GetStringProperty("vertexPrefix",  propertyValue);
-      std::string fragmentPrefix = GetStringProperty("fragmentPrefix",  propertyValue);
-      std::string vertex         = GetStringProperty("vertex", propertyValue);
-      std::string fragment       = GetStringProperty("fragment", propertyValue);
-
-      SetPrograms( vertexPrefix, fragmentPrefix, vertex, fragment );
-      break;
-    }
-
-    case Dali::ShaderEffect::Property::GEOMETRY_HINTS:
-    {
-      mGeometryHints = Dali::ShaderEffect::HINT_NONE;
-      std::string s = propertyValue.Get<std::string>();
-      if(s == "HINT_NONE")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_NONE;
-      }
-      else if(s == "HINT_GRID_X")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_GRID_X;
-      }
-      else if(s == "HINT_GRID_Y")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_GRID_Y;
-      }
-      else if(s == "HINT_GRID")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_GRID;
-      }
-      else if(s == "HINT_DEPTH_BUFFER")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_DEPTH_BUFFER;
-      }
-      else if(s == "HINT_BLENDING")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_BLENDING;
-      }
-      else if(s == "HINT_DOESNT_MODIFY_GEOMETRY")
-      {
-        mGeometryHints = Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY;
-      }
-      else
-      {
-        DALI_ASSERT_ALWAYS(!"Geometry hint unknown" );
-      }
-      break;
-    }
-
-    default:
-    {
-      // nothing to do
-      break;
-    }
-  }
-}
-
-Property::Value ShaderEffect::GetDefaultProperty(Property::Index /*index*/) const
-{
-  // none of our properties are readable so return empty
-  return Property::Value();
-}
-
-const SceneGraph::PropertyOwner* ShaderEffect::GetSceneObject() const
-{
-  return mShader->GetSceneObject();
-}
-
-const SceneGraph::PropertyBase* ShaderEffect::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
-  return mShader->GetSceneObjectAnimatableProperty( index );
-}
-
-const PropertyInputImpl* ShaderEffect::GetSceneObjectInputProperty( Property::Index index ) const
-{
-  return mShader->GetSceneObjectInputProperty( index );
-}
-
-int ShaderEffect::GetPropertyComponentIndex( Property::Index index ) const
-{
-  return mShader->GetPropertyComponentIndex( index );
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/event/effects/shader-effect-impl.h b/dali/internal/event/effects/shader-effect-impl.h
deleted file mode 100644 (file)
index 0ee4e07..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-#ifndef __DALI_INTERNAL_SHADER_EFFECT_H__
-#define __DALI_INTERNAL_SHADER_EFFECT_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/image.h>
-#include <dali/devel-api/shader-effects/shader-effect.h>
-#include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/effects/shader-declarations.h>
-#include <dali/internal/event/common/object-impl.h>
-#include <dali/internal/event/rendering/shader-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-/**
- * An abstract base class for a shader effect object.
- * The corresponding scene-graph object is a collection of shader programs,
- * which can apply the same effect to different geometry types.
- */
-class ShaderEffect : public Object
-{
-public:
-  typedef Dali::ShaderEffect::UniformCoordinateType UniformCoordinateType;
-
-  /**
-   * Create a new ShaderEffect with no programs
-   * @param hints GeometryHints to define the geometry of the rendered object
-   * @return A smart-pointer to a newly allocated shader effect.
-   */
-  static ShaderEffectPtr New( Dali::ShaderEffect::GeometryHints hints = Dali::ShaderEffect::HINT_NONE );
-
-  /**
-   * @copydoc Dali::ShaderEffect::SetEffectImage
-   */
-  void SetEffectImage( Dali::Image image );
-
-  /**
-   * @copydoc Dali::ShaderEffect::SetUniform( const std::string& name, Property::Value value, UniformCoordinateType uniformCoordinateType )
-   */
-  void SetUniform( const std::string& name,
-                   Property::Value value,
-                   UniformCoordinateType uniformCoordinateType );
-
-  /**
-   * Add a GeometryType specific default program to this ShaderEffect
-   * @param[in] geometryType    The GeometryType rendered by the shader program
-   * @param[in] vertexSource    The source code for the vertex shader
-   * @param[in] fragmentSource  The source code for the fragment shader
-   */
-  void SetPrograms( const std::string& vertexSource, const std::string& fragmentSource );
-
-  /**
-   * Add a default program to this ShaderEffect.
-   * This overload allows the optional prefixing for both the vertex and fragment shader.
-   * A useful prefix may be shader \#defines for conditional compilation.
-   * @param[in] vertexPrefix    The prefix source code for the vertex shader
-   * @param[in] fragmentPrefix  The prefix source code for the fragment shader
-   * @param[in] vertexSource    The source code for the vertex shader
-   * @param[in] fragmentSource  The source code for the fragment shader
-   */
-  void SetPrograms( const std::string& vertexPrefix, const std::string& fragmentPrefix,
-                    const std::string& vertexSource, const std::string& fragmentSource );
-
-  /**
-   * @brief Notify ShaderEffect that it's being used by an Actor.
-   *
-   * @param[in] actor The Actor that is connecting to this ShaderEffect
-   */
-  void Connect( ActorPtr actor );
-
-  /**
-   * @brief Notify ShaderEffect that an Actor is no longer using it.
-   *
-   * @param[in] actor The Actor that is disconnecting from this ShaderEffect
-   */
-  void Disconnect( ActorPtr actor );
-
-public:
-
-  /**
-   * Returns the shader for this ShaderEffect
-   *
-   * @return Returns the shader for this ShaderEffect
-   */
-  ShaderPtr GetShader() const { return mShader; }
-
-  /**
-   * Returns the geometry grid size.
-   *
-   * @param[in] size The pixel area size.
-   * @return Returns the geometry grid size
-   */
-  Vector2 GetGridSize( const Vector2& size );
-
-  /**
-   * Returns the effect image for this ShaderEffect
-   *
-   * @return Returns the effect image for this ShaderEffect
-   */
-  Dali::Image GetEffectImage() const { return mEffectImage; }
-
-public: //  override property functions from Object
-
-  /**
-   * @copydoc Dali::Handle::GetPropertyCount()
-   */
-  virtual unsigned int GetPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Handle::GetPropertyName()
-   */
-  virtual std::string GetPropertyName( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Handle::GetPropertyIndex()
-   */
-  virtual Property::Index GetPropertyIndex( const std::string& name ) const;
-
-  /**
-   * @copydoc Dali::Handle::IsPropertyWritable()
-   */
-  virtual bool IsPropertyWritable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Handle::IsPropertyAnimatable()
-   */
-  virtual bool IsPropertyAnimatable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Handle::IsPropertyAConstraintInput()
-   */
-  virtual bool IsPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Handle::GetPropertyType()
-   */
-  virtual Property::Type GetPropertyType( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Handle::SetProperty()
-   */
-  virtual void SetProperty( Property::Index index, const Property::Value& propertyValue );
-
-  /**
-   * @copydoc Dali::Handle::GetProperty()
-   */
-  virtual Property::Value GetProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Handle::GetPropertyIndices()
-   */
-  virtual void GetPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Handle::RegisterProperty()
-   */
-  virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
-
-  /**
-   * @copydoc Dali::Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
-   */
-  virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode );
-
-  /**
-   * @copydoc Dali::Handle::AddPropertyNotification()
-   */
-  virtual Dali::PropertyNotification AddPropertyNotification( Property::Index index,
-                                                              int componentIndex,
-                                                              const Dali::PropertyCondition& condition );
-
-  /**
-   * @copydoc Dali::Handle::RemovePropertyNotification()
-   */
-  virtual void RemovePropertyNotification( Dali::PropertyNotification propertyNotification );
-
-  /**
-   * @copydoc Dali::Handle::RemovePropertyNotifications()
-   */
-  virtual void RemovePropertyNotifications();
-
-public: // Default property extensions from Object
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::SetDefaultProperty()
-   */
-  virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultProperty()
-   */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
-   */
-  virtual int GetPropertyComponentIndex( Property::Index index ) const;
-
-protected:
-
-  /**
-   * Protected constructor.
-   * @param[in] hints Geometry hints
-   */
-  ShaderEffect( Dali::ShaderEffect::GeometryHints hints );
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ShaderEffect();
-
-private:
-
-  // No copying allowed, thus these are undefined
-  ShaderEffect( const ShaderEffect& );
-  ShaderEffect& operator=( const ShaderEffect& rhs );
-
-private: // Data
-  std::vector< ActorPtr > mConnectedActors;               ///< The array of actors that are currently connected to this ShaderEffect
-  ShaderPtr               mShader;                        ///< The shader pointer
-  Dali::Image             mEffectImage;                   ///< The Client-side handle to the effect image
-  float                   mGridDensity;                  ///< The grid denisty
-  Dali::ShaderEffect::GeometryHints  mGeometryHints;     ///< shader geometry hints for building the geometry
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ShaderEffect& GetImplementation(Dali::ShaderEffect& effect)
-{
-  DALI_ASSERT_ALWAYS(effect && "ShaderEffect handle is empty");
-
-  BaseObject& handle = effect.GetBaseObject();
-
-  return static_cast<Internal::ShaderEffect&>(handle);
-}
-
-inline const Internal::ShaderEffect& GetImplementation(const Dali::ShaderEffect& effect)
-{
-  DALI_ASSERT_ALWAYS(effect && "ShaderEffect handle is empty");
-
-  const BaseObject& handle = effect.GetBaseObject();
-
-  return static_cast<const Internal::ShaderEffect&>(handle);
-}
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_SHADER_EFFECT_H__
index 3fbb14d..ae4e5d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
-#include <dali/internal/event/effects/shader-declarations.h>
-
-// compile time generated shader strings
-#include "dali-shaders.h"
 
 namespace
 {
@@ -146,11 +141,6 @@ void ShaderFactory::SaveBinary( Internal::ShaderDataPtr shaderData )
   if( saved ) {} // Avoid unused variable warning in release builds
 }
 
-void ShaderFactory::LoadDefaultShaders()
-{
-  mDefaultShader = ShaderEffect::New();
-}
-
 void ShaderFactory::MemoryCacheInsert( ShaderData& shaderData )
 {
   DALI_ASSERT_DEBUG( shaderData.GetBufferSize() > 0 );
index 9fdf663..ab3051f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SHADER_FACTORY_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,7 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/internal/event/effects/shader-declarations.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/shader-data.h>
 #include <dali/internal/common/shader-saver.h>
@@ -35,9 +34,9 @@ class ShaderData;
 typedef IntrusivePtr<ShaderData> ShaderDataPtr;
 
 /**
- * ShaderFactory is an object which manages shader binary resource load requests,
- * It triggers the load requests during core initialization and sends a message to the
- * render manager with information about all the requested shader binaries.
+ * @brief ShaderFactory loads and saves shader binaries synchronously.
+ *
+ * Binaries loaded or saved are also cached by the ShaderFactory.
  */
 class ShaderFactory : public ShaderSaver
 {
@@ -72,6 +71,7 @@ public:
 
   /**
    * @brief Saves shader to memory cache and filesystem.
+   *
    * This is called when a shader binary is ready to be saved to the memory cache file system.
    * Shaders that pass through here become available to subsequent invocations of Load.
    * @param[in] shader The data to be saved.
@@ -79,11 +79,6 @@ public:
    */
   virtual void SaveBinary( Internal::ShaderDataPtr shader );
 
-  /**
-   * Called during Core initialization to load the default shader.
-   */
-  void LoadDefaultShaders();
-
 private:
 
   void MemoryCacheInsert( Internal::ShaderData& shaderData );
@@ -95,7 +90,6 @@ private:
   ShaderFactory& operator=( const ShaderFactory& rhs );
 
 private:
-  ShaderEffectPtr                           mDefaultShader;
   Dali::Vector< Internal::ShaderData* > mShaderBinaryCache; ///< Cache of pre-compiled shaders.
 
 }; // class ShaderFactory
index f5aecee..d2d2e2e 100644 (file)
@@ -201,12 +201,15 @@ void LongPressGestureProcessor::Process( const Integration::LongPressGestureEven
     }
 
     case Gesture::Continuing:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Continuing\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Continuing\n" );
       break;
-
+    }
     case Gesture::Clear:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Clear\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
       break;
+    }
   }
 }
 
index edb2abd..8bbc6f8 100644 (file)
@@ -229,8 +229,10 @@ void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent
     }
 
     case Gesture::Clear:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Clear\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
       break;
+    }
   }
 }
 
index 07051b6..6fc7c7c 100644 (file)
@@ -187,12 +187,15 @@ void PinchGestureProcessor::Process( const Integration::PinchGestureEvent& pinch
     }
 
     case Gesture::Clear:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Clear\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
       break;
-
+    }
     case Gesture::Possible:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Possible\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Possible\n" );
       break;
+    }
   }
 }
 
index 4cdb920..20a5f19 100644 (file)
@@ -139,16 +139,20 @@ void TapGestureProcessor::Process( const Integration::TapGestureEvent& tapEvent
     }
 
     case Gesture::Continuing:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Continuing\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Continuing\n" );
       break;
-
+    }
     case Gesture::Finished:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Finished\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Finished\n" );
       break;
-
+    }
     case Gesture::Clear:
-      DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Clear\n" );
+    {
+      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
       break;
+    }
   }
 }
 
index d9f30a1..a27c511 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/scripting/scripting.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
 #include <dali/internal/event/common/property-helper.h>    // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
@@ -64,7 +65,7 @@ DALI_PROPERTY( "stencilMask",                     INTEGER,   true, false,  false
 DALI_PROPERTY( "stencilOperationOnFail",          INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL )
 DALI_PROPERTY( "stencilOperationOnZFail",         INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL )
 DALI_PROPERTY( "stencilOperationOnZPass",         INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS )
-DALI_PROPERTY( "batchingEnabled",                 BOOLEAN,   true, false,  false, Dali::Renderer::Property::BATCHING_ENABLED )
+DALI_PROPERTY( "batchingEnabled",                 BOOLEAN,   true, false,  false, Dali::DevelRenderer::Property::BATCHING_ENABLED )
 DALI_PROPERTY_TABLE_END( DEFAULT_RENDERER_PROPERTY_START_INDEX )
 
 // Property string to enumeration tables:
@@ -651,7 +652,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       }
       break;
     }
-    case Dali::Renderer::Property::BATCHING_ENABLED:
+    case Dali::DevelRenderer::Property::BATCHING_ENABLED:
     {
       bool enabled;
       if( propertyValue.Get( enabled ) )
@@ -777,7 +778,7 @@ Property::Value Renderer::GetDefaultProperty( Property::Index index ) const
       value = mDepthWriteMode;
       break;
     }
-    case Dali::Renderer::Property::BATCHING_ENABLED:
+    case Dali::DevelRenderer::Property::BATCHING_ENABLED:
     {
       value = mBatchingEnabled;
       break;
diff --git a/dali/internal/event/resources/archive.cpp b/dali/internal/event/resources/archive.cpp
deleted file mode 100644 (file)
index fe163c6..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/resources/archive.h>
-
-// EXTERNAL INCLUDES
-#include <fstream>
-#include <ios>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/math/matrix.h>
-#include <dali/public-api/math/quaternion.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-/*--------- Archive ---------*/
-
-Archive::Archive(std::streambuf& buf)
-: mVersion(0),
-  mStream(&buf),
-  mResult(true)
-{
-}
-
-Archive::~Archive()
-{
-  if(!mChunkStack.empty())
-  {
-    DALI_LOG_ERROR("mChunkStack should be empty!\n");
-  }
-}
-
-
-/*--------- OutputArchive ---------*/
-
-OutputArchive::OutputArchive(std::streambuf& buf, const unsigned int version)
-: Archive(buf)
-{
-  SetVersion(version);
-}
-
-OutputArchive::~OutputArchive()
-{
-}
-
-bool OutputArchive::Write(const char* data, const unsigned int length)
-{
-  if( mResult )
-  {
-    mStream.write(data, length);
-    if( mStream.bad() )
-    {
-      mResult = false;
-    }
-  }
-  return mResult;
-}
-
-bool OutputArchive::OpenChunk(const unsigned int fourCC)
-{
-  const unsigned int zero = 0;
-
-  // Get current position in stream
-  std::streampos currentPos = mStream.tellp();
-
-  // Ensure chunk will start at an even byte
-  // (necessary for nested chunks)
-  if( currentPos & 1 )
-  {
-    const char padding = 0;
-    Write(&padding, sizeof(char));
-  }
-
-  // Write chunk header to stream
-  Write(reinterpret_cast<const char*>(&fourCC), sizeof(unsigned int));
-
-  // Push chunkHeader information to chunk LIFO stack
-  mChunkStack.push(std::make_pair(fourCC, mStream.tellp()));
-
-  // Write zero for chunk length temporarily. This will be overwritten in CloseChunk
-  Write(reinterpret_cast<const char*>(&zero), sizeof(unsigned int));
-
-  return mResult;
-}
-
-void OutputArchive::CloseChunk()
-{
-  // Get current position in stream
-  std::streampos currentPos = mStream.tellp();
-
-  // retrieve chunk header
-  ChunkHeader chunkHeader = mChunkStack.top();
-  mChunkStack.pop();
-
-  // seek to chunk header in stream
-  mStream.seekp(chunkHeader.second);
-
-  // calculate and write chunk size
-  unsigned int chunkLength = static_cast<unsigned int>(currentPos - chunkHeader.second) - sizeof(unsigned int);
-  Write(reinterpret_cast<const char*>(&chunkLength), sizeof(unsigned int));
-
-  // return to current position in stream
-  mStream.seekp(currentPos);
-
-  // Ensure next chunk will start at on even byte
-  if( currentPos & 1 )
-  {
-    const char padding = 0;
-    Write(&padding, 1);
-  }
-}
-
-
-/*--------- InputArchive ---------*/
-
-InputArchive::InputArchive(std::streambuf& buf, const unsigned int version)
-: Archive(buf),
-  mFileVersion(0)
-{
-  SetVersion(version);
-}
-
-InputArchive::~InputArchive()
-{
-}
-
-bool InputArchive::Read(char* data, const unsigned int length)
-{
-  if( mResult )
-  {
-    mStream.read(data, length);
-    if( mStream.bad() )
-    {
-      mResult = false;
-    }
-  }
-  return mResult;
-}
-
-bool InputArchive::OpenChunk(const unsigned int fourCC)
-{
-  if( PeekChunk() != fourCC )
-  {
-    // trying to open incorrect chunk, mark archive error
-    mResult = false;
-    return mResult;
-  }
-
-  union
-  {
-    unsigned int fourCC_int;
-    char fourCC_char[4];
-  };
-  fourCC_int = 0;
-
-  if( mStream.tellg() & 1 )
-  {
-    mStream.seekg(1, std::ios_base::cur);
-  }
-
-  Read(fourCC_char, sizeof(unsigned int));
-
-  // Push chunkHeader information to chunk LIFO stack
-  mChunkStack.push(std::make_pair(fourCC_int, mStream.tellg()));
-
-# if defined(DEBUG_ENABLED)
-
-  unsigned int chunkLength;
-  Read(reinterpret_cast<char*>(&chunkLength), sizeof(unsigned int));
-
-  DALI_LOG_INFO(Debug::Filter::gModel, Debug::Verbose, "Enter: %c%c%c%c(%d)\n",
-                fourCC_char[0], fourCC_char[1], fourCC_char[2], fourCC_char[3], chunkLength);
-
-# else  // defined(DEBUG_ENABLED)
-
-  // skip chunk length
-  mStream.seekg(sizeof(unsigned int), std::ios_base::cur);
-
-# endif // defined(DEBUG_ENABLED)
-
-  return mResult;
-}
-
-void InputArchive::SkipChunk(const unsigned int fourCC)
-{
-  // Ensure the next chunk is the correct one
-  if( PeekChunk() != fourCC )
-  {
-    return;
-  }
-
-  union
-  {
-    unsigned int fourCC_int;
-    char fourCC_char[4];
-  };
-  unsigned int chunkLength;
-
-  if( mStream.tellg() & 1 )
-  {
-    mStream.seekg(1, std::ios_base::cur);
-  }
-
-  Read(fourCC_char, sizeof(unsigned int));
-  Read(reinterpret_cast<char*>(&chunkLength), sizeof(unsigned int));
-
-  DALI_LOG_INFO(Debug::Filter::gModel, Debug::Verbose, "Enter: %c%c%c%c(%d)\n",
-                fourCC_char[0], fourCC_char[1], fourCC_char[2], fourCC_char[3], chunkLength);
-
-  if( chunkLength & 1 )
-  {
-    ++chunkLength;
-  }
-
-  mStream.seekg(chunkLength, std::ios_base::cur);
-}
-
-void InputArchive::CloseChunk()
-{
-  ChunkHeader chunkHeader = mChunkStack.top();
-  mChunkStack.pop();
-
-  mStream.seekg(chunkHeader.second);
-
-  unsigned int chunkLength;
-  Read(reinterpret_cast<char*>(&chunkLength), sizeof(unsigned int));
-
-  if( chunkLength & 1)
-  {
-    ++chunkLength;
-  }
-  mStream.seekg(chunkLength, std::ios_base::cur);
-}
-
-unsigned int InputArchive::PeekChunk()
-{
-  union
-  {
-    unsigned int fourCC_int;
-    char fourCC_char[4];
-  };
-  fourCC_int = 0;
-
-  // Get current position in stream
-  std::streampos currentPos = mStream.tellg();
-
-  // Ensure next read will be from an even byte
-  if( currentPos & 1 )
-  {
-    mStream.seekg(1, std::ios_base::cur);
-  }
-
-  // Read tag
-  Read(fourCC_char, sizeof(unsigned int));
-
-# if defined(DEBUG_ENABLED)
-  unsigned int chunkLength;
-  Read(reinterpret_cast<char*>(&chunkLength), sizeof(unsigned int));
-
-  DALI_LOG_INFO(Debug::Filter::gModel, Debug::Verbose, "Peek: %c%c%c%c(%d)\n",
-                fourCC_char[0], fourCC_char[1], fourCC_char[2], fourCC_char[3], chunkLength);
-# endif // defined(DEBUG_ENABLED)
-
-  // return to original position in stream
-  mStream.seekg(currentPos);
-
-  return fourCC_int;
-}
-
-namespace Serialize
-{
-/*------ serialization overrides of operator<< () and operator>> () ------*/
-
-Archive& operator<< (Archive& ar, const char& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, char& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator<< (Archive& ar, const unsigned char& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, unsigned char& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator<< (Archive& ar, const bool& t)
-{
-  char value = t ? 1 : 0;
-  ar.Write(&value, sizeof(value));
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, bool& t)
-{
-  char value;
-  ar.Read(&value, sizeof(value));
-  t = value != 0;
-
-  return ar;
-}
-
-Archive& operator<< (Archive& ar, const short& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, short& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator<< (Archive& ar, const unsigned short& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, unsigned short& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator<< (Archive& ar, const int& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, int& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator<< (Archive& ar, const unsigned int& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, unsigned int& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-// float
-Archive& operator<< (Archive& ar, const float& t)
-{
-  ar.Write((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, float& t)
-{
-  ar.Read((char*)&t, sizeof(t));
-
-  return ar;
-}
-
-// Vector2
-Archive& operator<< (Archive& ar, const Vector2& t)
-{
-  ar << t.x << t.y;
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, Vector2& t)
-{
-  ar >> t.x >> t.y;
-  return ar;
-}
-
-// Vector3
-Archive& operator<< (Archive& ar, const Vector3& t)
-{
-  ar << t.x << t.y << t.z;
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, Vector3& t)
-{
-  ar >> t.x >> t.y >> t.z;
-  return ar;
-}
-
-// Vector4
-Archive& operator<< (Archive& ar, const Vector4& t)
-{
-  ar << t.x << t.y << t.z << t.w;
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, Vector4& t)
-{
-  ar >> t.x >> t.y >> t.z >> t.w;
-  return ar;
-}
-
-// Quaternion
-Archive& operator<< (Archive& ar, const Quaternion& t)
-{
-  ar << t.mVector;
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, Quaternion& t)
-{
-  ar >> t.mVector;
-
-  return ar;
-}
-
-// Matrix
-Archive& operator<< (Archive& ar, const Matrix& t)
-{
-  const float* data = t.AsFloat();
-
-  for( unsigned i = 0; i < sizeof(Matrix) / sizeof(float); ++i)
-  {
-    ar << *data;
-    ++data;
-  }
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, Matrix& t)
-{
-  float* data = t.AsFloat();
-
-  for( unsigned i = 0; i < sizeof(Matrix) / sizeof(float); ++i)
-  {
-    ar >> *data;
-    ++data;
-  }
-
-  return ar;
-}
-
-/*---- std::string ----*/
-Archive& operator<< (Archive& ar, const std::string& t)
-{
-  unsigned int length = t.size();
-  ar << length;
-  ar.Write(t.data(), length);
-
-  return ar;
-}
-
-Archive& operator>> (Archive& ar, std::string& t)
-{
-  unsigned int length = 0;
-  char* data = NULL;
-
-  ar >> length;
-  data = new char[ length ];
-  ar.Read(data, length);
-  t.assign(data, length);
-  delete [] data;
-
-  return ar;
-}
-
-} // namespace Serialize
-
-} // Internal
-
-} // Dali
-
diff --git a/dali/internal/event/resources/archive.h b/dali/internal/event/resources/archive.h
deleted file mode 100644 (file)
index 2cd0d93..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-#if !defined(__DALI_INTERNAL_ARCHIVE_H__)
-#define __DALI_INTERNAL_ARCHIVE_H__
-
-/*
- * Copyright (c) 2014 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 <string>
-#include <iostream>
-#include <stack>
-
-namespace Dali
-{
-struct Vector2;
-struct Vector3;
-struct Vector4;
-class Matrix;
-class Quaternion;
-
-namespace Internal
-{
-
-/**
- * Archive class. Serializes data to a Tag-Length-Value archive
- */
-class Archive
-{
-public:
-  typedef std::pair<unsigned int, std::streampos> ChunkHeader;
-
-public:
-  /**
-   * Constructor
-   * @param[in] buf An open streambuf
-   */
-  Archive(std::streambuf& buf);
-
-  /**
-   * Destructor
-   */
-  virtual ~Archive();
-
-  /**
-   * Get archive version
-   */
-  unsigned int GetVersion() const
-  {
-    return mVersion;
-  }
-
-  /**
-   * Set archive version
-   * @param[in] version the version number
-   */
-  void SetVersion(const unsigned int version)
-  {
-    mVersion = version;
-  }
-
-  /**
-   * Returns the result of the archiving operation
-   * The result status is initialised to true on construction
-   * Any failure will set it to false
-   * @return the archiving result, true signals success.
-   */
-  bool GetResult() const
-  {
-    return mResult;
-  }
-
-  /**
-   * Set the archive status to failed
-   */
-  void SetResultFailed()
-  {
-    mResult = false;
-  }
-
-  /**
-   * Write a bytestream to the archive
-   * @param[in] data    A pointer to the data
-   * @param[in] length  The length of the data in bytes
-   * @return            true if the data was successfully written
-   */
-  virtual bool Write(const char* data, const unsigned int length)
-  {
-    return false;
-  }
-
-  /**
-   * Read a bytestream from the archive
-   * @param[in] data    A pointer to a buffer to store the data
-   * @param[in] length  The length of the data in bytes
-   * @return            true if the data was successfully read
-   */
-  virtual bool Read(char* data, const unsigned int length)
-  {
-    return false;
-  }
-
-  /**
-   * Open a new chunk
-   * @param[in] tag The FourCC tag for the chunk
-   * @return true if success.
-   */
-  virtual bool OpenChunk(const unsigned int tag) = 0;
-
-  /**
-   * Skip an entire chunk
-   * @param[in] tag The FourCC tag for the chunk
-   */
-  virtual void SkipChunk(const unsigned int tag)
-  {
-  }
-
-  /**
-   * Close the current chunk
-   * The chunk length is written to the archive
-   */
-  virtual void CloseChunk() = 0;
-
-  /**
-   * Peek at the tag of the next chunk.
-   * This will move the file pointer to the next even byte,
-   * then read the next four bytes
-   * @result The FourCC tag for the next chunk.
-   */
-  virtual unsigned int PeekChunk()
-  {
-    return 0;
-  }
-
-protected:
-  unsigned int            mVersion;
-  std::iostream           mStream;
-  std::stack<ChunkHeader> mChunkStack;
-  bool                    mResult;
-}; // class Archive
-
-/**
- * Archive specialization. Performs serialization to an Archive
- */
-class OutputArchive : public Archive
-{
-public:
-  OutputArchive(std::streambuf& buf, const unsigned int version);
-  virtual ~OutputArchive();
-
-public: // from Archive
-  /**
-   * @copydoc Archive::Write()
-   */
-  virtual bool Write(const char* data, const unsigned int length);
-
-  /**
-   * @copydoc Archive::OpenChunk()
-   * @param[in] tag The chunk tag
-   */
-  virtual bool OpenChunk(const unsigned int tag);
-
-  /**
-   * @copydoc Archive::CloseChunk()
-   */
-  virtual void CloseChunk();
-
-}; // class OutputArchive
-
-/**
- * Archive specialization. Performs serialization from an Archive
- */
-class InputArchive : public Archive
-{
-public:
-  InputArchive(std::streambuf& buf, const unsigned int version);
-  virtual ~InputArchive();
-
-public: // from Archive
-  /**
-   * @copydoc Archive::Read()
-   */
-  virtual bool Read(char* data, const unsigned int length);
-
-  /**
-   * @copydoc Archive::OpenChunk()
-   * @param[in] tag The chunk tag
-   */
-  virtual bool OpenChunk(const unsigned int tag);
-
-  /**
-   * @copydoc Archive::SkipChunk()
-   * @param[in] tag The chunk tag
-   */
-  virtual void SkipChunk(const unsigned int tag);
-
-  /**
-   * @copydoc Archive::CloseChunk()
-   */
-  virtual void CloseChunk();
-
-  /**
-   * @copydoc Archive::PeekChunk()
-   */
-  virtual unsigned int PeekChunk();
-
-public:
-  /**
-   * Set the archive version as read from the archive
-   * @param[in] version The archives version number
-   */
-  void SetFileVersion(unsigned int version)
-  {
-    mFileVersion = version;
-  }
-
-  /**
-   * Get the archive version number read from the archive
-   */
-  unsigned int GetFileVersion() const
-  {
-    return mFileVersion;
-  }
-private:
-  unsigned int  mFileVersion;
-
-}; // class InputArchive
-
-namespace Serialize
-{
-
-Archive& operator<< (Archive&, const char&);
-Archive& operator>> (Archive&, char&);
-Archive& operator<< (Archive&, const unsigned char&);
-Archive& operator>> (Archive&, unsigned char&);
-Archive& operator<< (Archive&, const bool&);
-Archive& operator>> (Archive&, bool&);
-Archive& operator<< (Archive&, const short&);
-Archive& operator>> (Archive&, short&);
-Archive& operator<< (Archive&, const unsigned short&);
-Archive& operator>> (Archive&, unsigned short&);
-Archive& operator<< (Archive&, const int&);
-Archive& operator>> (Archive&, int&);
-Archive& operator<< (Archive&, const unsigned int&);
-Archive& operator>> (Archive&, unsigned int&);
-Archive& operator<< (Archive&, const float&);
-Archive& operator>> (Archive&, float&);
-
-Archive& operator<< (Archive&, const std::string&);
-Archive& operator>> (Archive&, std::string&);
-
-// math
-Archive& operator<< (Archive&, const Vector2&);
-Archive& operator>> (Archive&, Vector2&);
-Archive& operator<< (Archive&, const Vector3&);
-Archive& operator>> (Archive&, Vector3&);
-Archive& operator<< (Archive&, const Vector4&);
-Archive& operator>> (Archive&, Vector4&);
-Archive& operator<< (Archive&, const Quaternion&);
-Archive& operator>> (Archive&, Quaternion&);
-Archive& operator<< (Archive&, const Matrix&);
-Archive& operator>> (Archive&, Matrix&);
-
-} // namespace Serialize
-} // Internal
-
-} // Dali
-
-#endif // !defined(__DALI_INTERNAL_ARCHIVE_H__)
-
-
index a4d1c9d..168959e 100644 (file)
@@ -40,7 +40,6 @@ internal_src_files = \
   $(internal_src_dir)/event/common/thread-local-storage.cpp \
   $(internal_src_dir)/event/common/type-info-impl.cpp \
   $(internal_src_dir)/event/common/type-registry-impl.cpp \
-  $(internal_src_dir)/event/effects/shader-effect-impl.cpp \
   $(internal_src_dir)/event/effects/shader-factory.cpp \
   $(internal_src_dir)/event/events/actor-gesture-data.cpp \
   $(internal_src_dir)/event/events/actor-observer.cpp \
@@ -87,7 +86,6 @@ internal_src_files = \
   $(internal_src_dir)/event/rendering/renderer-impl.cpp \
   $(internal_src_dir)/event/rendering/sampler-impl.cpp \
   $(internal_src_dir)/event/rendering/shader-impl.cpp \
-  $(internal_src_dir)/event/resources/archive.cpp \
   $(internal_src_dir)/event/resources/image-ticket.cpp \
   $(internal_src_dir)/event/resources/resource-client.cpp \
   $(internal_src_dir)/event/resources/resource-ticket.cpp \
@@ -120,7 +118,6 @@ internal_src_files = \
   $(internal_src_dir)/render/renderers/render-property-buffer.cpp \
   $(internal_src_dir)/render/renderers/render-renderer.cpp \
   $(internal_src_dir)/render/renderers/render-texture.cpp \
-  $(internal_src_dir)/render/shaders/custom-uniform.cpp \
   $(internal_src_dir)/render/shaders/program.cpp \
   $(internal_src_dir)/render/shaders/program-controller.cpp \
   $(internal_src_dir)/render/shaders/scene-graph-shader.cpp \
index e1c697e..5a4a5f4 100644 (file)
@@ -219,7 +219,6 @@ bool FrameBufferTexture::CreateGlTexture()
   if ( GL_FRAMEBUFFER_COMPLETE != status )
   {
     DALI_LOG_ERROR( "status (0x%x), glError (0x%x)\n", status, mContext.GetError() );
-    DALI_ASSERT_ALWAYS( false && "Frame buffer is not complete!" );
   }
 
   return mId != 0;
index bbbbfa7..c3c2a48 100644 (file)
@@ -26,7 +26,6 @@
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/type-abstraction-enums.h>
 #include <dali/internal/event/common/property-input-impl.h>
-#include <dali/internal/event/effects/shader-declarations.h>
 #include <dali/internal/render/data-providers/render-data-provider.h>
 #include <dali/internal/render/gl-resources/gl-resource-owner.h>
 #include <dali/internal/render/renderers/render-geometry.h>
@@ -463,7 +462,6 @@ private:
 
   DepthFunction::Type          mDepthFunction:3;            ///< The depth function
   FaceCullingMode::Type        mFaceCullingMode:2;          ///< The mode of face culling
-  BlendMode::Type              mBlendMode:2;                ///< The mode of blending
   DepthWriteMode::Type         mDepthWriteMode:2;           ///< The depth write mode
   DepthTestMode::Type          mDepthTestMode:2;            ///< The depth test mode
   bool                         mUpdateAttributesLocation:1; ///< Indicates attribute locations have changed
diff --git a/dali/internal/render/shader-source/README b/dali/internal/render/shader-source/README
deleted file mode 100644 (file)
index 26166ad..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-Automatic Shader String Generation
-----------------------------------
-
- - The filename of the shaders determines the strings that are generated.
- - Ensure your shader is named according to the following rules:
-   - All lowercase.
-   - Word separation using "-".
-   - Suffix should be ".txt".
-   - For example: "my-new-shader.txt".
- - Both the vertex and the fragment shader should be stored in the same text file.
- - The vertex shader should be encapsulated within "<VertexShader>" and "</VertexShader>".
- - The fragment shader should be encapsulated within "<FragmentShader>" and "</FragmentShader>".
- - A header and a source file will be automatically generated using this information.
-   - They will contain several string constants.
-   - The generated strings will be in camel case using the dashes to separate out the words.
-     - e.g, for "my-new-shader.txt", we will get "MyNewShaderVertex" & "MyNewShaderFragment".
- - When you wish to use these strings in your code, you should include the file "dali-shaders.h".
-
diff --git a/dali/internal/render/shader-source/image.txt b/dali/internal/render/shader-source/image.txt
deleted file mode 100644 (file)
index 6ad19f8..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<VertexShader>
-
-attribute mediump vec3  aPosition;
-attribute mediump vec2  aTexCoord;
-
-uniform   mediump mat4  uModelView;
-uniform   mediump mat4  uProjection;
-uniform   mediump mat4  uMvpMatrix;
-uniform   mediump mat3  uNormalMatrix;
-uniform   mediump mat4  uModelMatrix;
-uniform   mediump mat4  uViewMatrix;
-
-uniform   mediump vec4  uColor;
-uniform   mediump vec3  uSize;
-
-varying   mediump vec2  vTexCoord;
-
-uniform   mediump vec4  sTextureRect;
-
-void main()
-{
-  gl_Position = uMvpMatrix * vec4(aPosition, 1.0);
-  vTexCoord = aTexCoord;
-}
-
-</VertexShader>
-
-<FragmentShader>
-
-uniform sampler2D sTexture;
-uniform sampler2D sEffect;
-
-uniform mediump vec4 sTextureRect;
-uniform mediump vec4 uColor;
-
-varying mediump vec2 vTexCoord;
-
-void main()
-{
-  gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;
-}
-
-</FragmentShader>
diff --git a/dali/internal/render/shaders/custom-uniform.cpp b/dali/internal/render/shaders/custom-uniform.cpp
deleted file mode 100644 (file)
index 082fbb5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/render/shaders/custom-uniform.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/render/shaders/program.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-CustomUniform::CustomUniform()
-: mCacheIndex( 0 )
-{
-}
-
-CustomUniform::~CustomUniform()
-{
-}
-
-void CustomUniform::Initialize( Program& program, const char* name )
-{
-  mCacheIndex = program.RegisterUniform( name );
-}
-
-void CustomUniform::Reset()
-{
-  mCacheIndex = 0;
-}
-
-int CustomUniform::GetUniformLocation( Program& program, const char* name )
-{
-  if( 0 == mCacheIndex )
-  {
-    Initialize( program, name );
-  }
-
-  return program.GetUniformLocation( mCacheIndex );
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/render/shaders/custom-uniform.h b/dali/internal/render/shaders/custom-uniform.h
deleted file mode 100644 (file)
index e718f7f..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef __DALI_INTERNAL_CUSTOM_UNIFORM_H__
-#define __DALI_INTERNAL_CUSTOM_UNIFORM_H__
-
-/*
- * Copyright (c) 2014 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 <string>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class Program;
-
-/**
- * Helper class to handle the index of the custom uniforms
- */
-class CustomUniform
-{
-public: // API
-
-  /**
-   * Creates a custom uniform
-   */
-  CustomUniform();
-
-  /**
-   * Destructor, nonvirtual as not a base class
-   */
-  ~CustomUniform();
-
-  /**
-   * Initializes the custom uniform. Should be called only once
-   * @param program to use
-   * @param name of the uniform
-   */
-  void Initialize( Program& program, const char* name );
-
-  /**
-   * Resets the custom uniform in case program was changed
-   */
-  void Reset();
-
-  /**
-   * Gets the uniform location for custom uniform
-   * @param program to use
-   * @param name of the uniform
-   */
-  int GetUniformLocation( Program& program, const char* name );
-
-private: // Data
-
-  unsigned int mCacheIndex; ///< internal cache index
-
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_CUSTOM_UNIFORM_H__
-
index 7c40a01..4a20377 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/gl-abstraction.h> // for GLenum
+#include <dali/internal/common/shader-data.h>
 
 namespace Dali
 {
index ead14d6..9c3945e 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/common/owner-container.h>
+#include <dali/internal/common/shader-data.h>
 #include <dali/internal/render/shaders/program.h>
 #include <dali/internal/render/shaders/program-cache.h>
 
index 182c5ec..876d4eb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_SHADER_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -19,7 +19,6 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/shader-effects/shader-effect.h>
 #include <dali/internal/common/shader-data.h>
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/common/scene-graph-connection-change-propagator.h>
index d8e0c0e..d6a1fa5 100644 (file)
@@ -19,7 +19,6 @@
 #include <dali/internal/update/manager/render-instruction-processor.h>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/shader-effects/shader-effect.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/actors/layer-impl.h> // for the default sorting function
@@ -225,7 +224,7 @@ inline void AddRendererToRenderList( BufferIndex updateBufferIndex,
 
       if( !isLayer3d )
       {
-        item.mDepthIndex += static_cast<int>( renderable.mNode->GetDepth() ) * Dali::Layer::TREE_DEPTH_MULTIPLIER;
+        item.mDepthIndex += renderable.mNode->GetDepthIndex();
       }
 
       // Save ModelView matrix onto the item.
index e620005..ec99e03 100644 (file)
@@ -93,6 +93,7 @@ Layer* FindLayer( Node& node )
  * @param[in] currentLayer The current layer containing lists of opaque/transparent renderables.
  * @param[in] renderTask The current render-task.
  * @param[in] inheritedDrawMode The draw mode of the parent
+ * @param[in] parentDepthIndex The inherited parent node depth index
  * @param[in] currentClippingId The current Clipping Id
  *              Note: ClippingId is passed by reference, so it is permanently modified when traversing back up the tree for uniqueness.
  * @param[in] clippingDepth The current clipping depth
index 73b52ee..150556d 100644 (file)
@@ -74,8 +74,8 @@ Node::Node()
   mExclusiveRenderTask( NULL ),
   mChildren(),
   mClippingDepth( 0u ),
+  mDepthIndex( 0u ),
   mRegenerateUniformMap( 0 ),
-  mDepth( 0u ),
   mDirtyFlags( AllFlags ),
   mDrawMode( DrawMode::NORMAL ),
   mColorMode( DEFAULT_COLOR_MODE ),
@@ -296,7 +296,6 @@ void Node::SetParent( Node& parentNode )
   DALI_ASSERT_ALWAYS(mParent == NULL);
 
   mParent = &parentNode;
-  mDepth = mParent->GetDepth() + 1u;
 
   if( mTransformId != INVALID_TRANSFORM_ID )
   {
@@ -343,7 +342,6 @@ void Node::RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex )
 
   // Remove back-pointer to parent
   mParent = NULL;
-  mDepth = 0u;
 
   // Remove all child pointers
   mChildren.Clear();
index 3cd0117..6e3f98d 100644 (file)
@@ -715,11 +715,6 @@ public:
     return ( this == rhs );
   }
 
-  unsigned short GetDepth() const
-  {
-    return mDepth;
-  }
-
   /**
    * @brief Turns on or off being a batch parent for the node
    * @param[in] enabled If true the node becomes a parent for batch of its children
@@ -727,6 +722,18 @@ public:
   void SetIsBatchParent( bool enabled );
 
   /**
+   * @brief Sets the sibling order of the node
+   * @param[in] order The new order
+   */
+  void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; }
+
+  /**
+   * @brief Get the depth index of the node
+   * @return Current depth index
+   */
+  unsigned int GetDepthIndex(){ return mDepthIndex; }
+
+  /**
    * @brief Tells if the node is a batch parent
    * @return True if node is a batch parent, false otherwise.
    */
@@ -887,10 +894,11 @@ protected:
   CollectedUniformMap                mCollectedUniformMap[2]; ///< Uniform maps of the node
   unsigned int                       mUniformMapChanged[2];   ///< Records if the uniform map has been altered this frame
   uint32_t                           mClippingDepth;          ///< The number of clipping nodes deep this node is
-  unsigned int                       mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
+
+  uint32_t                           mDepthIndex;             ///< Depth index of the node
 
   // flags, compressed to bitfield
-  unsigned short                     mDepth:12;               ///< Depth in the hierarchy
+  unsigned int                       mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
   int                                mDirtyFlags:8;           ///< A composite set of flags for each of the Node properties
   DrawMode::Type                     mDrawMode:2;             ///< How the Node and its children should be drawn
   ColorMode                          mColorMode:2;            ///< Determines whether mWorldColor is inherited, 2 bits is enough
@@ -1013,6 +1021,17 @@ inline void SetIsBatchParentMessage( EventThreadServices& eventThreadServices, c
   new (slot) LocalType( &node, &Node::SetIsBatchParent, isBatchParent );
 }
 
+inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex )
+{
+  typedef MessageValue1< Node, unsigned int > LocalType;
+
+  // Reserve some memory inside the message queue
+  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex );
+}
+
 inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, const Node& node, ClippingMode::Type clippingMode )
 {
   typedef MessageValue1< Node, ClippingMode::Type > LocalType;
index cc9d7b6..e5dadd2 100644 (file)
@@ -304,7 +304,6 @@ public:
       MAXIMUM_SIZE,                                       ///< name "maximumSize",           type Vector2     @SINCE_1_0.0
       INHERIT_POSITION,                                   ///< name "inheritPosition",       type bool        @SINCE_1_1.24
       CLIPPING_MODE,                                      ///< name "clippingMode",          type String      @SINCE_1_2_5
-      BATCH_PARENT,                                       ///< name "batchParent",           type bool        @SINCE_1_2.0
     };
   };
 
index 08022ba..5170eba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
 namespace Dali
 {
 
-CustomActorImpl::~CustomActorImpl()
-{
-}
-
 CustomActor CustomActorImpl::Self() const
 {
   return CustomActor(mOwner);
@@ -44,6 +40,10 @@ CustomActorImpl::CustomActorImpl( ActorFlags flags )
 {
 }
 
+CustomActorImpl::~CustomActorImpl()
+{
+}
+
 void CustomActorImpl::Initialize(Internal::CustomActor& owner)
 {
   DALI_ASSERT_DEBUG(mOwner == NULL); // should not already be owned
index f1d8ed8..fadf9b5 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_CUSTOM_ACTOR_IMPL_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -68,12 +68,6 @@ public:
   class Extension; ///< Forward declare future extension interface
 
   /**
-   * @brief Virtual destructor
-   * @SINCE_1_0.0
-   */
-  virtual ~CustomActorImpl();
-
-  /**
    * @brief Used by derived CustomActorImpl instances, to access the public Actor interface.
    *
    * @SINCE_1_0.0
@@ -344,6 +338,12 @@ protected: // For derived classes
    */
   CustomActorImpl( ActorFlags flags );
 
+  /**
+   * @brief Virtual destructor
+   * @SINCE_1_0.0
+   */
+  virtual ~CustomActorImpl();
+
   // Size negotiation helpers
 
   /**
index 4663f95..0afc168 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,7 +23,6 @@
 #include <dali/public-api/animation/time-period.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/animation/animation-impl.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
 
 namespace Dali
 {
index 87e3347..31f6fdc 100644 (file)
@@ -228,7 +228,7 @@ Constraint Constraint::New( Handle handle, Property::Index targetIndex, Property
 
     default:
     {
-      DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should never come here
+      DALI_ABORT( "Property not constrainable" );
       break;
     }
   }
index 8879ce0..88f035f 100644 (file)
@@ -183,6 +183,12 @@ public:
   }
 #endif
 
+#define DALI_ABORT(message)                \
+  { \
+    Dali::DaliAssertMessage( ASSERT_LOCATION, message );   \
+    throw Dali::DaliException( ASSERT_LOCATION, message );  \
+  }
+
 /**
  * @brief An invariant concurrent assertion to ensure its argument evaluates TRUE in debug builds.
  *
index 838362f..43795b1 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int CORE_MAJOR_VERSION = 1;
 const unsigned int CORE_MINOR_VERSION = 2;
-const unsigned int CORE_MICRO_VERSION = 16;
+const unsigned int CORE_MICRO_VERSION = 17;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifndef EMSCRIPTEN
index aa6147d..80da558 100644 (file)
@@ -90,16 +90,6 @@ Property::Index Handle::GetPropertyIndex( const std::string& name ) const
   return GetImplementation(*this).GetPropertyIndex( name );
 }
 
-Property::Index Handle::GetPropertyIndex( Property::Index key ) const
-{
-  return GetImplementation(*this).GetPropertyIndex( key );
-}
-
-Property::Index Handle::GetPropertyIndex( Property::Key key ) const
-{
-  return GetImplementation(*this).GetPropertyIndex( key );
-}
-
 bool Handle::IsPropertyWritable( Property::Index index ) const
 {
   return GetImplementation(*this).IsPropertyWritable( index );
@@ -130,11 +120,6 @@ Property::Index Handle::RegisterProperty( const std::string& name, const Propert
   return GetImplementation(*this).RegisterProperty( name, propertyValue );
 }
 
-Property::Index Handle::RegisterProperty( Property::Index key, const std::string& name, const Property::Value& propertyValue )
-{
-  return GetImplementation(*this).RegisterProperty( name, key, propertyValue );
-}
-
 Property::Index Handle::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode )
 {
   return GetImplementation(*this).RegisterProperty( name, propertyValue, accessMode );
index b5a7f0e..7d0e5a0 100644 (file)
@@ -178,36 +178,6 @@ public:
   Property::Index GetPropertyIndex( const std::string& name ) const;
 
   /**
-   * @brief Query the index of a custom property matching the given key.
-   *
-   * Returns the first custom property that matches the given integer key. This is
-   * useful for other classes that know the key but not the name. Requires the property
-   * to have been registered with the associated key.
-   *
-   * @note This key is not the same as the Property enum found in
-   * objects such as Actor (which is a preset index).
-   *
-   * @SINCE_1_2.1
-   * @param [in] key The integer key of the property
-   * @return The index of the property, or Property::INVALID_INDEX if no property exists with the given key.
-   * @note The key is not the same as the returned index, though it has the same type.
-   */
-  Property::Index GetPropertyIndex( Property::Index key ) const;
-
-  /**
-   * @brief Query the index of a property using the given key from a Property::Map
-   * @SINCE_1_2.7
-   *
-   * @param[in] key The key of the property to search for.
-   * @return the matching property index of either the string key or the matching
-   * custom property index of the index key, or Property::INVALID_INDEX if no
-   * property matches the given key.
-   *
-   * @note See also, GetPropertyIndex(Property::Index) and GetPropertyIndex(const std::string&)
-   */
-  Property::Index GetPropertyIndex( Property::Key key ) const;
-
-  /**
    * @brief Query whether a property can be set using SetProperty().
    *
    * @SINCE_1_0.0
@@ -282,40 +252,6 @@ public:
   Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
 
   /**
-   * @brief Register a new animatable property with an integer key.
-   *
-   * @SINCE_1_2.1
-   * @param [in] key  The integer key of the property.
-   * @param [in] name The text key of the property.
-   * @param [in] propertyValue The new value of the property.
-   * @return The index of the property or Property::INVALID_INDEX if registration failed
-   * @pre The object supports dynamic properties i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true.
-   * Property names and keys are expected to be unique, but this is not enforced.
-   * Property indices are unique to each registered custom property in a given object.
-   * @note Returns Property::INVALID_INDEX if registration failed. This can happen if you try to register
-   * animatable property on an object that does not have scene graph object.
-   * @note The returned property index is not the same as the integer key (though it shares a type)
-   *
-   * This version of RegisterProperty associates both an integer key
-   * and the text key with the property, allowing for lookup of the
-   * property index by either key or name ( which is useful when other
-   * classes know the key but not the name )
-   *
-   * @note Only the following types can be animated:
-   *       - Property::BOOLEAN
-   *       - Property::FLOAT
-   *       - Property::INTEGER
-   *       - Property::VECTOR2
-   *       - Property::VECTOR3
-   *       - Property::VECTOR4
-   *       - Property::MATRIX3
-   *       - Property::MATRIX
-   *       - Property::ROTATION
-   * @note If a property with the desired name already exists, then the value given is just set.
-   */
-  Property::Index RegisterProperty( Property::Index key, const std::string& name, const Property::Value& propertyValue );
-
-  /**
    * @brief Register a new property.
    *
    * Properties can be set as non animatable using property attributes.
index c5a0d8c..6a9d849 100644 (file)
@@ -414,14 +414,6 @@ public:
        * @SINCE_1_1.43
        */
       STENCIL_OPERATION_ON_Z_PASS,
-
-      /**
-       * @brief name "batchingEnabled", type BOOLEAN
-       * @SINCE_1_2.0
-       * @see Batching
-       * @note The default value is 'false'
-       */
-      BATCHING_ENABLED
     };
   };
 
index 8d759e7..9080179 100644 (file)
@@ -219,7 +219,7 @@ void BaseSignal::SlotDisconnected( CallbackBase* callback )
     }
   }
 
-  DALI_ASSERT_ALWAYS( false && "Callback lost in SlotDisconnected()" );
+  DALI_ABORT( "Callback lost in SlotDisconnected()" );
 }
 
 CallbackBase* BaseSignal::GetCallback( std::size_t connectionIndex ) const
index fd7514e..0be40a1 100644 (file)
@@ -79,7 +79,7 @@ void ConnectionTracker::SignalDisconnected( SlotObserver* signal, CallbackBase*
     }
   }
 
-  DALI_ASSERT_ALWAYS( false && "Callback lost in SignalDisconnected()" );
+  DALI_ABORT( "Callback lost in SignalDisconnected()" );
 }
 
 std::size_t ConnectionTracker::GetConnectionCount() const
index 2c93ad5..2fcfb27 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    The OpenGLES Canvas Core Library
-Version:    1.2.16
+Version:    1.2.17
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT