utc-Dali-Text-Markup.cpp
utc-Dali-Text-Typesetter.cpp
utc-Dali-Text-ViewModel.cpp
+ utc-Dali-DebugRendering.cpp
)
# Append list of test harness files (Won't get parsed for test cases)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror")
+ADD_DEFINITIONS(-DTEST_RESOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../resources\" )
+
FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${directory}")
ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
* limitations under the License.
*
*/
+#include <unistd.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/visuals/wireframe/wireframe-visual.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/geometry.h>
{
const char* TEST_IMAGE_FILE_NAME = "image_01.jpg";
const char* TEST_NPATCH_FILE_NAME = "image_01.9.jpg";
+const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
+const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
-bool IsDebugVisual( Visual::Base& visual )
+const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
+
+void TestDebugVisual( Visual::Base& visual, Visual::Type actualType, Vector2 expectedNaturalSize )
{
- bool isDebugVisualType = false;
- bool isGeometryLineType = false;
+ DALI_TEST_CHECK( &typeid( Toolkit::Internal::WireframeVisual ) == &typeid( GetImplementation(visual) ) );
+
+ Vector2 naturalSize;
+ visual.GetNaturalSize( naturalSize );
+ DALI_TEST_EQUALS( naturalSize, expectedNaturalSize, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
Property::Map propertyMap;
visual.CreatePropertyMap( propertyMap );
Property::Value* typeValue = propertyMap.Find( Visual::Property::TYPE, Property::INTEGER );
if ( typeValue )
{
- isDebugVisualType = ( typeValue->Get<int>() == Visual::WIREFRAME ); // Debug Rendering uses the WireframeVisual
+ DALI_TEST_CHECK( typeValue->Get<int>() == actualType );
}
DummyControl actor = DummyControl::New();
if( actor.GetRendererCount() > 0 )
{
Geometry geometry = actor.GetRendererAt( 0 ).GetGeometry();
- isGeometryLineType = ( geometry.GetType() == Geometry::LINES );
+ DALI_TEST_CHECK( geometry.GetType() == Geometry::LINES );
}
-
- return isDebugVisualType && isGeometryLineType;
}
}
propertyMap1.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
Visual::Base colorVisual = factory.CreateVisual(propertyMap1);
DALI_TEST_CHECK( colorVisual );
- DALI_TEST_CHECK( IsDebugVisual( colorVisual ) );
+ TestDebugVisual( colorVisual, Visual::COLOR, Vector2::ZERO );
// Test that border visual is replaced with debug visual
Property::Map propertyMap2;
propertyMap2.Insert(BorderVisual::Property::SIZE, 2.f);
Visual::Base borderVisual = factory.CreateVisual(propertyMap2);
DALI_TEST_CHECK( borderVisual );
- DALI_TEST_CHECK( IsDebugVisual( borderVisual ) );
+ TestDebugVisual( borderVisual, Visual::BORDER, Vector2::ZERO );
// Test that gradient visual is replaced with debug visual
Property::Map propertyMap3;
propertyMap3.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
Visual::Base gradientVisual = factory.CreateVisual(propertyMap3);
DALI_TEST_CHECK( gradientVisual );
- DALI_TEST_CHECK( IsDebugVisual( gradientVisual ) );
+ TestDebugVisual( gradientVisual, Visual::GRADIENT, Vector2::ZERO );
// Test that image visual is replaced with debug visual
Property::Map propertyMap4;
propertyMap4.Insert( Visual::Property::TYPE, Visual::IMAGE );
propertyMap4.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+ propertyMap4.Insert( ImageVisual::Property::DESIRED_WIDTH, 50.f );
+ propertyMap4.Insert( ImageVisual::Property::DESIRED_HEIGHT, 100.f );
Visual::Base imageVisual = factory.CreateVisual( propertyMap4 );
DALI_TEST_CHECK( imageVisual );
- DALI_TEST_CHECK( IsDebugVisual( imageVisual ) );
+ TestDebugVisual( imageVisual, Visual::IMAGE, Vector2( 50.f, 100.f ) );
- // Test that n patch visual is replaced with debug visual
+ // Test that SVG visual is replaced with debug visual
+ // TEST_SVG_FILE:
+ // <svg width="100" height="100">
+ // <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
+ // </svg>
Property::Map propertyMap5;
propertyMap5.Insert( Visual::Property::TYPE, Visual::IMAGE );
- propertyMap5.Insert( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME );
- Visual::Base nPatchVisual = factory.CreateVisual( propertyMap4 );
- DALI_TEST_CHECK( nPatchVisual );
- DALI_TEST_CHECK( IsDebugVisual( nPatchVisual ) );
+ propertyMap5.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
+ Visual::Base svgVisual = factory.CreateVisual( propertyMap5 );
+ DALI_TEST_CHECK( svgVisual );
+ TestDebugVisual( svgVisual, Visual::IMAGE, Vector2(100.f, 100.f) );
+
+ // Test that AnimatedImageVisual is replaced with debug visual
+ // TEST_GIF_FILE: anim.gif
+ // resolution: 50*50, frame count: 4, frame delay: 0.2 second for each frame
+ Property::Map propertyMap6;
+ propertyMap6.Insert( Visual::Property::TYPE, Visual::IMAGE );
+ propertyMap6.Insert( ImageVisual::Property::URL, TEST_GIF_FILE_NAME );
+ Visual::Base animatedImageVisual = factory.CreateVisual( propertyMap6 );
+ DALI_TEST_CHECK( animatedImageVisual );
+ TestDebugVisual( animatedImageVisual, Visual::IMAGE, Vector2(50.f, 50.f) );
+
+ // Test that text visual is replaced with debug visual
+
+ // Load some fonts to get the same metrics on different platforms.
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.SetDpi( 96u, 96u );
+
+ char* pathNamePtr = get_current_dir_name();
+ const std::string pathName( pathNamePtr );
+ free( pathNamePtr );
+
+ fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
+
+ Property::Map propertyMap7;
+ propertyMap7.Insert( Visual::Property::TYPE, DevelVisual::TEXT );
+ propertyMap7.Insert( TextVisual::Property::ENABLE_MARKUP, true );
+ propertyMap7.Insert( TextVisual::Property::TEXT, "<font family='TizenSans' size='12'>Hello world</font>" );
+ propertyMap7.Insert( TextVisual::Property::MULTI_LINE, true );
+
+ Visual::Base textVisual = factory.CreateVisual( propertyMap7 );
+ DALI_TEST_CHECK( textVisual );
+ DALI_TEST_CHECK( &typeid( Toolkit::Internal::WireframeVisual ) == &typeid( GetImplementation(textVisual) ) );
+
+ Vector2 naturalSize;
+ textVisual.GetNaturalSize( naturalSize );
+ DALI_TEST_EQUALS( naturalSize, Vector2( 80.f, 20.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+ const float height = textVisual.GetHeightForWidth( 40.f );
+ DALI_TEST_EQUALS( height, 40.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
EnvironmentVariable::SetTestingEnvironmentVariable(false);
END_TEST;
Visual::Base colorVisual = factory.CreateVisual( map);
DALI_TEST_CHECK( colorVisual );
- DALI_TEST_CHECK( IsDebugVisual( colorVisual ) );
+ TestDebugVisual( colorVisual, Visual::COLOR, Vector2::ZERO );
// Test that border visual is replaced with debug visual
map.Clear();
map[ BorderVisual::Property::SIZE ] = 2.f;
Visual::Base borderVisual = factory.CreateVisual( map );
DALI_TEST_CHECK( borderVisual );
- DALI_TEST_CHECK( IsDebugVisual( borderVisual ) );
+ TestDebugVisual( borderVisual, Visual::BORDER, Vector2::ZERO );
// Test that image visual is replaced with debug visual
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
Visual::Base imageVisual = factory.CreateVisual( image );
DALI_TEST_CHECK( imageVisual );
- DALI_TEST_CHECK( IsDebugVisual( imageVisual ) );
+ TestDebugVisual( imageVisual, Visual::IMAGE, Vector2::ZERO);
// Test that n patch visual is replaced with debug visual
Visual::Base nPatchVisual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() );
DALI_TEST_CHECK( nPatchVisual );
- DALI_TEST_CHECK( IsDebugVisual( nPatchVisual ) );
+ TestDebugVisual( nPatchVisual, Visual::IMAGE, Vector2::ZERO );
EnvironmentVariable::SetTestingEnvironmentVariable(false);
END_TEST;
utc-Dali-Model3dView.cpp
utc-Dali-Visual.cpp
utc-Dali-VisualFactory.cpp
- utc-Dali-DebugRendering.cpp
utc-Dali-ImageAtlas.cpp
utc-Dali-VideoView.cpp
utc-Dali-AsyncImageLoader.cpp
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
-void DummyControlImplOverride::OnStageConnection( int depth ) { Control::OnStageConnection( depth ); stageConnectionCalled = true; }
+void DummyControlImplOverride::OnStageConnection( int depth ) { stageConnectionCalled = true; Control::OnStageConnection( depth ); }
void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); }
-void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; }
-void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; }
-void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; }
-void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; }
+void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; Control::OnChildAdd( child ); }
+void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; Control::OnChildRemove( child ); }
+void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; Control::OnSizeSet( targetSize ); }
+void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; Control::OnSizeAnimation( animation, targetSize ); }
bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
+
+int UtcDaliControlAutoClipping(void)
+{
+ ToolkitTestApplication application;
+ Control control = Control::New();
+
+ tet_infoline( "Test to see if a renderer gets added when we are clipping children" );
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+
+ Stage::GetCurrent().Add( control );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliControlAutoClippingN(void)
+{
+ ToolkitTestApplication application;
+ Control control = Control::New();
+ control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+ .Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
+
+ tet_infoline( "Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals" );
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+
+ Stage::GetCurrent().Add( control );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION ); // Only 1, not 2
+
+ // Ensure the background color is still RED rather than what's set by the automatic clipping
+ Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK( map );
+ Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR );
+ DALI_TEST_CHECK( colorValue );
+ DALI_TEST_EQUALS( colorValue->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliControlAutoClippingWhenAlreadyOnStage(void)
+{
+ ToolkitTestApplication application;
+ Control control = Control::New();
+
+ tet_infoline( "Test to see if a renderer gets added when we are clipping children and when already on stage" );
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ Stage::GetCurrent().Add( control );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliControlAutoClippingWhenAlreadyOnStageN(void)
+{
+ ToolkitTestApplication application;
+ Control control = Control::New();
+ control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
+ .Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
+
+ tet_infoline( "Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals and when already on stage" );
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ Stage::GetCurrent().Add( control );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
+
+ control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION ); // Still should be 1
+
+ // Ensure the background color is still RED rather than what's set by the automatic clipping
+ Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK( map );
+ Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR );
+ DALI_TEST_CHECK( colorValue );
+ DALI_TEST_EQUALS( colorValue->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+
+ END_TEST;
+}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
+int UtcDaliControlImplAutoClippingWithVisuals(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline( "Test to ensure a renderer does NOT get added when we've already registered a visual which we haven't enabled" );
+
+ DummyControl control = DummyControl::New();
+ DummyControlImpl& controlImpl = static_cast<DummyControlImpl&>( control.GetImplementation() );
+
+ Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+ Toolkit::Visual::Base visual;
+ Property::Map map;
+ map[Visual::Property::TYPE] = Visual::COLOR;
+ map[ColorVisual::Property::MIX_COLOR] = Color::RED;
+ visual = visualFactory.CreateVisual( map );
+ DALI_TEST_CHECK(visual);
+ controlImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual, false );
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+
+ Stage::GetCurrent().Add( control );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliControlImplAutoClippingWithVisualsAlreadyOnStage(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline( "Test to ensure a renderer does NOT get added when we've already registered a visual which we haven't enabled and we're already on the stage" );
+
+ DummyControl control = DummyControl::New();
+ DummyControlImpl& controlImpl = static_cast<DummyControlImpl&>( control.GetImplementation() );
+
+ Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+ Toolkit::Visual::Base visual;
+ Property::Map map;
+ map[Visual::Property::TYPE] = Visual::COLOR;
+ map[ColorVisual::Property::MIX_COLOR] = Color::RED;
+ visual = visualFactory.CreateVisual( map );
+ DALI_TEST_CHECK(visual);
+ controlImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual, false );
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ Stage::GetCurrent().Add( control );
+
+ application.SendNotification();
+ application.Render();
+
+ control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+
+ END_TEST;
+}
END_TEST;
}
+
+int UtcDaliTableViewKeyboardFocusInNestedTableView(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(3, 3);
+ tableView.SetKeyboardFocusable( true );
+ tableView.SetName( "TableView");
+
+ for ( int row = 0; row < 3; ++row )
+ {
+ for ( int col = 0; col < 3; ++col )
+ {
+ std::ostringstream str;
+ str << row << "-" << col;
+
+ if (row == 1 && col ==1)
+ {
+ // Add a nested 2x2 table view in the middle cell of the parent table view
+ TableView childTableView = TableView::New(2, 2);
+ childTableView.SetName( str.str() );
+
+ for(int childRow = 0; childRow < 2; childRow++)
+ {
+ for(int childCol = 0; childCol < 2; childCol++)
+ {
+ Control control = Control::New();
+ std::ostringstream nameStr;
+ nameStr << row << "-" << col << "-" << childRow << "-" << childCol;
+ control.SetName( nameStr.str() );
+ control.SetKeyboardFocusable( true );
+ childTableView.AddChild( control, TableView::CellPosition( childRow, childCol ) );
+ }
+ }
+ tableView.AddChild( childTableView, TableView::CellPosition( row, col ) );
+ }
+ else
+ {
+ Control control = Control::New();
+ control.SetName( str.str() );
+ control.SetKeyboardFocusable( true );
+ tableView.AddChild( control, TableView::CellPosition( row, col ) );
+ }
+ }
+ }
+
+ Stage::GetCurrent().Add( tableView );
+
+ application.SendNotification();
+ application.Render();
+
+ Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
+ DALI_TEST_CHECK( firstFocusActor );
+ DALI_TEST_CHECK( firstFocusActor.GetName() == "0-0" );
+
+ KeyboardFocusManager manager = KeyboardFocusManager::Get();
+ manager.SetFocusGroupLoop( false );
+ manager.SetCurrentFocusActor( firstFocusActor );
+
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-1" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-2" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-2" );
+
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-0" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-2" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-1" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-0" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-0" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
+
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-0" );
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
+
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-1" );
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+
+ END_TEST;
+}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void BloomView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
mChildrenRoot.SetSize(targetSize);
mCompositeImageView.SetSize(targetSize);
Deactivate();
Activate();
}
+
+ Control::OnSizeSet( targetSize );
}
void BloomView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mInternalRoot)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void BloomView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void EffectsView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
// if we are already on stage, need to update render target sizes now to reflect the new size of this actor
}
mChildrenRoot.SetSize( targetSize );
+
+ Control::OnSizeSet( targetSize );
}
void EffectsView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
Enable();
+
+ Control::OnStageConnection( depth );
}
void EffectsView::OnStageDisconnection()
void EffectsView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mCameraForChildren )
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void EffectsView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void FlexContainer::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
// Anchor actor to top left of the container
child.SetAnchorPoint( AnchorPoint::TOP_LEFT );
child.SetParentOrigin( ParentOrigin::TOP_LEFT );
childNode.node->get_child = GetChildNodeAtIndex;
childNode.node->is_dirty = IsNodeDirty;
mChildrenNodes.push_back(childNode);
+
+ Control::OnChildAdd( child );
}
void FlexContainer::OnChildRemove( Actor& child )
RelayoutRequest();
}
-}
-void FlexContainer::OnSizeAnimation( Animation& animation, const Vector3& targetSize )
-{
- // @todo Animate the children to their target size and position
+ Control::OnSizeSet( size );
}
void FlexContainer::ComputeLayout()
#define __DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
virtual void OnSizeSet( const Vector3& size );
- /**
- * @copydoc CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
- */
- virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
-
private: // Implementation
/**
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
mChildrenRoot.SetSize(targetSize);
Deactivate();
Activate();
}
+
+ Control::OnSizeSet( targetSize );
}
void GaussianBlurView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mInternalRoot)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void GaussianBlurView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Magnifier::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
// TODO: Once Camera/CameraActor properties function as proper animatable properties
// this code can disappear.
// whenever the size of the magnifier changes, the field of view needs to change
// a constraint yet as Camera/CameraActor properties are not animatable/constrainable.
mActorSize = targetSize;
Update();
+
+ Control::OnSizeSet( targetSize );
}
float Magnifier::GetMagnificationFactor() const
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Model3dView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
CustomActor self = Self();
self.AddRenderer( mRenderer );
constraint.AddSource( Source( self, Toolkit::Model3dView::Property::LIGHT_POSITION ) );
constraint.Apply();
}
+
+ Control::OnStageConnection( depth );
}
///////////////////////////////////////////////////////////
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void NavigationView::OnStageConnection( int depth )
{
Self().SetSensitive(true);
+
+ Control::OnStageConnection( depth );
}
void NavigationView::Push( Actor& actor )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void PageTurnView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
SetupShadowView();
+
+ Control::OnStageConnection( depth );
}
void PageTurnView::OnStageDisconnection()
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Popup::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
mLayoutDirty = true;
RelayoutRequest();
+
+ Control::OnStageConnection( depth );
}
void Popup::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
// Re-parent any children added by user to the body layer.
if( mAlterAddedChild )
{
mLayoutDirty = true;
RelayoutRequest();
}
+
+ Control::OnChildAdd( child );
}
void Popup::LayoutContext( const Vector2& size )
float DEFAULT_VALUE = 0.0f;
float DEFAULT_LOWER_BOUND = 0.0f;
float DEFAULT_UPPER_BOUND = 1.0f;
-float DEFAULT_PADDING = 24.0f;
} // Unnamed namespace
void ProgressBar::OnRelayout( const Vector2& size, RelayoutContainer& container )
{
- Vector2 trackSize( size );
- trackSize.width = std::max( 0.0f, size.width - DEFAULT_PADDING ); // Ensure we don't go negative
-
// Track
if( mTrack )
{
- container.Add( mTrack, trackSize );
+ container.Add( mTrack, size );
// mValueTextLabel will have its relayout method called automatically as it's a child of mTrack,
// which is added to the container
// Progress bar
if( mProgress )
{
- mDomain = CalcDomain( trackSize );
+ mDomain = CalcDomain( size );
- Vector2 progressSize( trackSize );
+ Vector2 progressSize( size );
// If no progress, then we do not want a n-patch image shown incorrectly
progressSize.width = std::max( mProgressVisualSize.width, mDomain.from.x + mValue * ( mDomain.to.x - mDomain.from.x ) );
- progressSize.width = std::min( progressSize.width, trackSize.width ); // We should not exceed given size
+ progressSize.width = std::min( progressSize.width, size.width ); // We should not exceed given size
container.Add( mProgress, progressSize );
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
mIndicator.SetSize(size.width, mIndicatorFixedHeight);
}
+
+ Control::OnSizeSet( size );
}
void ScrollBar::SetScrollDirection( Toolkit::ScrollBar::Direction direction )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE);
}
}
+
+ Scrollable::OnChildAdd( child );
}
bool ItemView::OnWheelEvent(const WheelEvent& event)
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ScrollView::OnStageConnection( int depth )
{
- ScrollBase::OnStageConnection( depth );
-
DALI_LOG_SCROLL_STATE("[0x%X]", this);
if ( mSensitive )
SetScrollSensitive( false );
SetScrollSensitive( true );
}
+
if(IsOvershootEnabled())
{
// try and make sure property notifications are set
EnableScrollOvershoot(true);
}
+
+ ScrollBase::OnStageConnection( depth );
}
void ScrollView::OnStageDisconnection()
{
mOvershootIndicator->Reset();
}
+
+ ScrollBase::OnSizeSet( size );
}
void ScrollView::OnChildAdd(Actor& child)
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ShadowView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mBlurRootActor)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void ShadowView::OnChildRemove( Actor& child )
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
self.TouchSignal().Connect( this, &Slider::OnTouch );
}
-void Slider::OnSizeSet( const Vector3& size )
-{
-}
-
void Slider::OnRelayout( const Vector2& size, RelayoutContainer& container )
{
SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
#define __DALI_TOOLKIT_INTERNAL_SLIDER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual ~Slider();
/**
- * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
- */
- virtual void OnSizeSet( const Vector3& size );
-
- /**
* @copydoc CustomActorImpl::OnRelayout
*/
virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
SetImage( mInputImage );
}
}
+
+ Control::OnSizeSet( targetSize );
}
void SuperBlurView::OnStageConnection( int depth )
return;
}
- // Chaining up first ensures visuals have SetOnStage called to create their renderers
+ // Exception to the rule, chaining up first ensures visuals have SetOnStage called to create their renderers
Control::OnStageConnection( depth );
Actor self = Self();
// Note that the renderer indices are depending on the order they been added to the actor
// which might be different from the blur level of its texture.
// We can check the depth index of the renderer to know which blurred image it renders.
+ // All visuals WILL have renderers at this point as we are simply creating visuals with an Image handle.
Renderer renderer = self.GetRendererAt( i );
int depthIndex = renderer.GetProperty<int>(Renderer::Property::DEPTH_INDEX);
if( depthIndex > 0 )
}
}
-void SuperBlurView::OnStageDisconnection( )
-{
- Control::OnStageDisconnection();
-}
-
Vector3 SuperBlurView::GetNaturalSize()
{
if( mInputImage )
#define __DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual void OnStageConnection( int depth );
/**
- * @copydoc CustomActorImpl::OnStageDisconnection()
- */
- virtual void OnStageDisconnection();
-
- /**
* @copydoc CustomActorImpl::GetNaturalSize()
*/
virtual Vector3 GetNaturalSize();
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// rows and columns must be recalculated or the new size will not take effect.
mRowDirty = mColumnDirty = true;
RelayoutRequest();
+
+ Control::OnSizeSet( size );
}
void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
void TableView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
- if( mLayoutingChild )
+ if( ! mLayoutingChild )
{
- // we're in the middle of laying out children so no point doing anything here
- return;
- }
+ // Ensure we're not in the middle of laying out children
- // Check child properties on actor to decide its position inside the table
- HorizontalAlignment::Type horizontalAlignment = HorizontalAlignment::LEFT;
- VerticalAlignment::Type verticalAlignment = VerticalAlignment::TOP;
+ // Check child properties on actor to decide its position inside the table
+ HorizontalAlignment::Type horizontalAlignment = HorizontalAlignment::LEFT;
+ VerticalAlignment::Type verticalAlignment = VerticalAlignment::TOP;
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ) != Property::NONE )
- {
- std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ).Get<std::string >();
- Scripting::GetEnumeration< HorizontalAlignment::Type >( value.c_str(),
- HORIZONTAL_ALIGNMENT_STRING_TABLE,
- HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
- horizontalAlignment );
- }
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ) != Property::NONE )
+ {
+ std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT ).Get<std::string >();
+ Scripting::GetEnumeration< HorizontalAlignment::Type >( value.c_str(),
+ HORIZONTAL_ALIGNMENT_STRING_TABLE,
+ HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
+ horizontalAlignment );
+ }
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ) != Property::NONE )
- {
- std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ).Get<std::string >();
- Scripting::GetEnumeration< VerticalAlignment::Type >( value.c_str(),
- VERTICAL_ALIGNMENT_STRING_TABLE,
- VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
- verticalAlignment );
- }
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ) != Property::NONE )
+ {
+ std::string value = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT ).Get<std::string >();
+ Scripting::GetEnumeration< VerticalAlignment::Type >( value.c_str(),
+ VERTICAL_ALIGNMENT_STRING_TABLE,
+ VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
+ verticalAlignment );
+ }
- Toolkit::TableView::CellPosition cellPosition;
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
- {
- cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
- }
+ Toolkit::TableView::CellPosition cellPosition;
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::ROW_SPAN ) != Property::NONE )
+ {
+ cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::ROW_SPAN ).Get<float>() );
+ }
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
- {
- cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
- }
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::COLUMN_SPAN ) != Property::NONE )
+ {
+ cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( Toolkit::TableView::ChildProperty::COLUMN_SPAN ).Get<float>() );
+ }
- if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
- {
- Vector2 indices = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_INDEX ).Get<Vector2 >();
- cellPosition.rowIndex = static_cast<unsigned int>( indices.x );
- cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
+ if( child.GetPropertyType( Toolkit::TableView::ChildProperty::CELL_INDEX ) != Property::NONE )
+ {
+ Vector2 indices = child.GetProperty( Toolkit::TableView::ChildProperty::CELL_INDEX ).Get<Vector2 >();
+ cellPosition.rowIndex = static_cast<unsigned int>( indices.x );
+ cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
- AddChild( child, cellPosition );
- SetCellAlignment(cellPosition, horizontalAlignment, verticalAlignment);
+ AddChild( child, cellPosition );
+ SetCellAlignment(cellPosition, horizontalAlignment, verticalAlignment);
+ }
+ else
+ {
+ bool availableCellFound = false;
- // Do not continue
- return;
- }
+ // Find the first available cell to store the actor in
+ const unsigned int rowCount = mCellData.GetRows();
+ const unsigned int columnCount = mCellData.GetColumns();
+ for( unsigned int row = 0; row < rowCount && !availableCellFound; ++row )
+ {
+ for( unsigned int column = 0; column < columnCount && !availableCellFound; ++column )
+ {
+ if( !(mCellData[ row ][ column ].actor) )
+ {
+ // Put the actor in the cell
+ CellData data;
+ data.actor = child;
+ data.position.columnIndex = column;
+ data.position.rowIndex = row;
+ data.horizontalAlignment = horizontalAlignment;
+ data.verticalAlignment = verticalAlignment;
+ mCellData[ row ][ column ] = data;
+
+ availableCellFound = true;
+ break;
+ }
+ }
+ }
- // Find the first available cell to store the actor in
- const unsigned int rowCount = mCellData.GetRows();
- const unsigned int columnCount = mCellData.GetColumns();
- for( unsigned int row = 0; row < rowCount; ++row )
- {
- for( unsigned int column = 0; column < columnCount; ++column )
- {
- if( !(mCellData[ row ][ column ].actor) )
+ if( ! availableCellFound )
{
- // Put the actor in the cell
+ // No empty cells, so increase size of the table
+ unsigned int newColumnCount = ( columnCount > 0 ) ? columnCount : 1;
+ ResizeContainers( rowCount + 1, newColumnCount );
+
+ // Put the actor in the first cell of the new row
CellData data;
data.actor = child;
- data.position.columnIndex = column;
- data.position.rowIndex = row;
+ data.position.rowIndex = rowCount;
+ data.position.columnIndex = 0;
data.horizontalAlignment = horizontalAlignment;
data.verticalAlignment = verticalAlignment;
- mCellData[ row ][ column ] = data;
-
- // Don't continue
- RelayoutRequest();
- return;
+ mCellData[ rowCount ][ 0 ] = data;
}
+
+ RelayoutRequest();
}
}
- // No empty cells, so increase size of the table
- unsigned int newColumnCount = ( columnCount > 0 ) ? columnCount : 1;
- ResizeContainers( rowCount + 1, newColumnCount );
-
- // Put the actor in the first cell of the new row
- CellData data;
- data.actor = child;
- data.position.rowIndex = rowCount;
- data.position.columnIndex = 0;
- data.horizontalAlignment = horizontalAlignment;
- data.verticalAlignment = verticalAlignment;
- mCellData[ rowCount ][ 0 ] = data;
- RelayoutRequest();
+ Control::OnChildAdd( child );
}
void TableView::OnChildRemove( Actor& child )
mRowDirty( true ), // Force recalculation first time
mColumnDirty( true )
{
+ mCurrentColumn = 0;
+ mCurrentRow = 0;
SetKeyboardNavigationSupport( true );
ResizeContainers( initialRows, initialColumns );
}
// Move the focus if we haven't lost it.
if(!focusLost)
{
+ // Save the new focus cell positions of TableView.
+ mCurrentColumn = currentColumn;
+ mCurrentRow = currentRow;
+
nextFocusableActor = GetChildAt(Toolkit::TableView::CellPosition(currentRow, currentColumn));
}
}
else
{
- // The current focused actor is not within table view, so the child in the first cell should be focused.
- nextFocusableActor = GetChildAt(Toolkit::TableView::CellPosition(0, 0));
+ // The current focused actor is not within TableView.
+ // This means that the TableView has gained the Focus again.
+
+ unsigned int numberOfColumns = GetColumns();
+ unsigned int numberOfRows = GetRows();
+
+ if( (mCurrentRow != 0 && mCurrentColumn != 0) && // Last saved cell was not the first cell
+ (mCurrentRow != numberOfRows - 1 && mCurrentColumn != numberOfColumns - 1) ) // Last saved cell was not the last cell
+ {
+ // This condition handles the cases when parent TableView gained the focus again after the child layout
+ // container (i.e. TableView) has no more items (i.e. actors) to be focused on in a given direction.
+
+ // Move the focus to next cell towards the given direction in a TableView if the last saved cell was not the first or last cell.
+ nextFocusableActor = GetNextKeyboardFocusableActor(GetChildAt(Toolkit::TableView::CellPosition(mCurrentRow, mCurrentColumn)), direction, loopEnabled);
+ }
+ else
+ {
+ // Otherwise, move the focus to either the first or the last cell according to the given direction.
+ if(direction == Toolkit::Control::KeyboardFocus::LEFT || direction == Toolkit::Control::KeyboardFocus::UP)
+ {
+ nextFocusableActor = GetChildAt(Toolkit::TableView::CellPosition(numberOfRows - 1, numberOfColumns - 1));
+ }
+ else
+ {
+ nextFocusableActor = GetChildAt(Toolkit::TableView::CellPosition(0, 0));
+ }
+ }
}
}
Size mFixedTotals; ///< Accumulated totals for fixed width and height
Size mPadding; ///< Padding to apply to each cell
+ unsigned int mCurrentRow; ///< Last / current focused row
+ unsigned int mCurrentColumn; ///< Last / current focused column
bool mLayoutingChild; ///< Can't be a bitfield due to Relayouting lock
bool mRowDirty : 1; ///< Flag to indicate the row data is dirty
bool mColumnDirty : 1; ///< Flag to indicate the column data is dirty
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void TextEditor::OnStageConnection( int depth )
{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
// Sets the depth to the visuals inside the text's decorator.
mDecorator->SetTextDepth( depth );
// The depth of the text renderer is set in the RenderText() called from OnRelayout().
+
+ // Call the Control::OnStageConnection() to set the depth of the background.
+ Control::OnStageConnection( depth );
}
bool TextEditor::OnTouched( Actor actor, const TouchData& touch )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void TextField::OnStageConnection( int depth )
{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
// Sets the depth to the visuals inside the text's decorator.
mDecorator->SetTextDepth( depth );
// The depth of the text renderer is set in the RenderText() called from OnRelayout().
+
+ // Call the Control::OnStageConnection() to set the depth of the background.
+ Control::OnStageConnection( depth );
}
bool TextField::OnTouched( Actor actor, const TouchData& touch )
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
-void TextLabel::OnStageConnection( int depth )
-{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
- // The depth of the text renderer is set in the RenderText() called from OnRelayout().
-}
-
void TextLabel::ScrollingFinished()
{
// Pure Virtual from TextScroller Interface
#define DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
virtual float GetHeightForWidth( float width );
- /**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
-
// From ControlInterface
/**
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
self.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
}
-void TextSelectionPopup::OnStageConnection( int depth )
-{
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextSelectionPopup::OnStageConnection\n" );
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
- // TextSelectionToolbar::OnStageConnection() will set the depths of all the popup's components.
-}
-
void TextSelectionPopup::HideAnimationFinished( Animation& animation )
{
Actor self = Self();
#define __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
virtual void OnInitialize();
- /**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
-
private: // Implementation
void HideAnimationFinished( Animation& animation );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mScrollView.SetRulerX( mRulerX );
}
-void TextSelectionToolbar::OnStageConnection( int depth )
-{
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
-
- // Texts are controls, they have their own OnStageConnection() implementation.
- // Icons are inside a TableView. It has it's own OnStageConnection() implementation.
-}
-
void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize )
{
mMaxSize = maxSize;
#define DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_TOOLBAR_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
/**
- * @copydoc Control::OnStageConnection()
- */
- virtual void OnStageConnection( int depth );
-
- /**
* @brief Set max size of Popup
* @param[in] maxSize Size (Vector2)
*/
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ToolBar::OnChildAdd(Actor& child)
{
- Control::OnChildAdd( child );
-
if( !mInitializing )
{
// An actor is being added through the Actor's API.
// No OnChildRemove method required because Actors are added to the mLayout table view, so if an
// actor is removed using the Actor::RemoveChild method it will not remove anything because the
// actor is in mLayout not in Self().
+
+ Control::OnChildAdd( child );
}
} // namespace Internal
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void VideoView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
if( mVisual )
{
CustomActor self = Self();
Toolkit::GetImplementation(mVisual).SetOnStage( self );
}
+
+ Control::OnStageConnection( depth );
}
void VideoView::OnStageDisconnection()
// Add effect texture to blend-two-image custom shader
TextureSet textureSet = mActorForBlending.GetRendererAt(0).GetTextures();
- TextureSetImage( textureSet, 1u, mInputImage );
+ if( textureSet )
+ {
+ TextureSetImage( textureSet, 1u, mInputImage );
+ }
SetupCamera();
CreateRenderTasks();
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void CubeTransitionEffect::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
Geometry geometry = VisualFactoryCache::CreateQuadGeometry();
Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mCurrentRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, depth );
Self().AddRenderer( mCurrentRenderer );
+
+ Control::OnStageConnection( depth );
}
void CubeTransitionEffect::OnStageDisconnection()
void PrimitiveVisual::GetNaturalSize( Vector2& naturalSize )
{
+ if( !mGeometry )
+ {
+ CreateGeometry();
+ }
+
naturalSize.x = mObjectDimensions.x;
naturalSize.y = mObjectDimensions.y;
}
virtual ~Base();
protected:
+
/**
* @brief Called by CreatePropertyMap() allowing sub classes to respond to the CreatePropertyMap event
*
*/
virtual void OnSetTransform() = 0;
-protected:
-
/**
* @brief Called by SetOnStage() allowing sub classes to respond to the SetOnStage event
*
Visual::BasePtr visualPtr;
- if( mDebugEnabled )
+ Property::Value* typeValue = propertyMap.Find( Toolkit::DevelVisual::Property::TYPE, VISUAL_TYPE );
+ Toolkit::DevelVisual::Type visualType = Toolkit::DevelVisual::IMAGE; // Default to IMAGE type.
+ if( typeValue )
{
- //Create a WireframeVisual if we have debug enabled
- visualPtr = WireframeVisual::New( *( mFactoryCache.Get() ) );
+ Scripting::GetEnumerationProperty( *typeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, visualType );
}
- else
+
+ switch( visualType )
{
- Property::Value* typeValue = propertyMap.Find( Toolkit::DevelVisual::Property::TYPE, VISUAL_TYPE );
- Toolkit::DevelVisual::Type visualType = Toolkit::DevelVisual::IMAGE; // Default to IMAGE type.
- if( typeValue )
+ case Toolkit::Visual::BORDER:
{
- Scripting::GetEnumerationProperty( *typeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, visualType );
+ visualPtr = BorderVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
}
- switch( visualType )
+ case Toolkit::Visual::COLOR:
{
- case Toolkit::Visual::BORDER:
- {
- visualPtr = BorderVisual::New( *( mFactoryCache.Get() ), propertyMap );
- break;
- }
-
- case Toolkit::Visual::COLOR:
- {
- visualPtr = ColorVisual::New( *( mFactoryCache.Get() ), propertyMap );
- break;
- }
+ visualPtr = ColorVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
+ }
- case Toolkit::Visual::GRADIENT:
- {
- visualPtr = GradientVisual::New( *( mFactoryCache.Get() ), propertyMap );
- break;
- }
+ case Toolkit::Visual::GRADIENT:
+ {
+ visualPtr = GradientVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
+ }
- case Toolkit::Visual::IMAGE:
+ case Toolkit::Visual::IMAGE:
+ {
+ Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+ std::string imageUrl;
+ if( imageURLValue && imageURLValue->Get( imageUrl ) )
{
- Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
- std::string imageUrl;
- if( imageURLValue && imageURLValue->Get( imageUrl ) )
+ // first resolve url type to know which visual to create
+ UrlType::Type type = ResolveUrlType( imageUrl );
+ if( UrlType::N_PATCH == type )
{
- // first resolve url type to know which visual to create
- UrlType::Type type = ResolveUrlType( imageUrl );
- if( UrlType::N_PATCH == type )
- {
- visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
- }
- else if( UrlType::SVG == type )
+ visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else if( UrlType::SVG == type )
+ {
+ visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else if( UrlType::GIF == type )
+ {
+ visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else // Regular image
+ {
+ bool batchingEnabled( false );
+ Property::Value* batchingEnabledValue = propertyMap.Find( Toolkit::ImageVisual::Property::BATCHING_ENABLED, BATCHING_ENABLED );
+ if( batchingEnabledValue )
{
- visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ batchingEnabledValue->Get( batchingEnabled );
}
- else if( UrlType::GIF == type )
+
+ if( batchingEnabled )
{
- visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ visualPtr = BatchImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
}
- else // Regular image
+ else
{
- bool batchingEnabled( false );
- Property::Value* batchingEnabledValue = propertyMap.Find( Toolkit::ImageVisual::Property::BATCHING_ENABLED, BATCHING_ENABLED );
- if( batchingEnabledValue )
- {
- batchingEnabledValue->Get( batchingEnabled );
- }
-
- if( batchingEnabled )
- {
- visualPtr = BatchImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
- }
- else
- {
- visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
- }
+ visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
}
}
-
- break;
}
- case Toolkit::Visual::MESH:
- {
- visualPtr = MeshVisual::New( *( mFactoryCache.Get() ), propertyMap );
- break;
- }
+ break;
+ }
- case Toolkit::Visual::PRIMITIVE:
- {
- visualPtr = PrimitiveVisual::New( *( mFactoryCache.Get() ), propertyMap );
- break;
- }
+ case Toolkit::Visual::MESH:
+ {
+ visualPtr = MeshVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
+ }
- case Toolkit::Visual::WIREFRAME:
- {
- visualPtr = WireframeVisual::New( *( mFactoryCache.Get() ) );
- break;
- }
+ case Toolkit::Visual::PRIMITIVE:
+ {
+ visualPtr = PrimitiveVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
+ }
- case Toolkit::DevelVisual::TEXT:
- {
- visualPtr = TextVisual::New( *( mFactoryCache.Get() ), propertyMap );
- break;
- }
+ case Toolkit::Visual::WIREFRAME:
+ {
+ visualPtr = WireframeVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
+ }
+
+ case Toolkit::DevelVisual::TEXT:
+ {
+ visualPtr = TextVisual::New( *( mFactoryCache.Get() ), propertyMap );
+ break;
}
}
DALI_LOG_ERROR( "Renderer type unknown\n" );
}
+ if( mDebugEnabled && visualType != Toolkit::DevelVisual::WIREFRAME )
+ {
+ //Create a WireframeVisual if we have debug enabled
+ visualPtr = WireframeVisual::New( *( mFactoryCache.Get() ), visualPtr, propertyMap );
+ }
+
return Toolkit::Visual::Base( visualPtr.Get() );
}
mFactoryCache = new VisualFactoryCache();
}
- if( mDebugEnabled )
- {
- return Toolkit::Visual::Base( WireframeVisual::New( *( mFactoryCache.Get() ) ).Get() );
- }
-
Visual::BasePtr visualPtr;
NinePatchImage npatchImage = NinePatchImage::DownCast( image );
visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), image );
}
+ if( mDebugEnabled )
+ {
+ //Create a WireframeVisual if we have debug enabled
+ visualPtr = WireframeVisual::New( *( mFactoryCache.Get() ), visualPtr );
+ }
+
return Toolkit::Visual::Base( visualPtr.Get() );
}
mFactoryCache = new VisualFactoryCache();
}
- if( mDebugEnabled )
- {
- return Toolkit::Visual::Base( WireframeVisual::New( *( mFactoryCache.Get() ) ).Get() );
- }
-
Visual::BasePtr visualPtr;
// first resolve url type to know which visual to create
visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), url, size );
}
+ if( mDebugEnabled )
+ {
+ //Create a WireframeVisual if we have debug enabled
+ visualPtr = WireframeVisual::New( *( mFactoryCache.Get() ), visualPtr );
+ }
+
return Toolkit::Visual::Base( visualPtr.Get() );
}
}
-WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache )
+WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, const Property::Map& properties )
{
- return new WireframeVisual( factoryCache );
+ Visual::BasePtr emtptyVisual;
+
+ return New(factoryCache, emtptyVisual, properties);
}
-WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache )
+WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual )
+{
+ return new WireframeVisual( factoryCache, actualVisual );
+}
+
+WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual, const Property::Map& properties )
+{
+ WireframeVisualPtr wireframeVisual( new WireframeVisual( factoryCache, actualVisual ) );
+
+ // Instead of calling SetProperties, looking for the only valid property 'transform'
+ Property::Value* transformValue = properties.Find( DevelVisual::Property::TRANSFORM, TRANSFORM );
+ Property::Map transformMap;
+ if( transformValue && transformValue->Get( transformMap ) )
+ {
+ wireframeVisual->SetTransformAndSize( transformMap, Vector2::ZERO );
+ }
+
+ return wireframeVisual;
+}
+
+WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual )
+: Visual::Base( factoryCache ),
+ mActualVisual( actualVisual )
{
}
{
}
+float WireframeVisual::GetHeightForWidth( float width )
+{
+ if( mActualVisual )
+ {
+ return mActualVisual->GetHeightForWidth( width );
+ }
+ else
+ {
+ return Visual::Base::GetHeightForWidth( width );
+ }
+}
+
+void WireframeVisual::GetNaturalSize( Vector2& naturalSize )
+{
+ if( mActualVisual )
+ {
+ mActualVisual->GetNaturalSize( naturalSize );
+ }
+ else
+ {
+ Visual::Base::GetNaturalSize( naturalSize );
+ }
+}
+
+void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
+{
+ if( mActualVisual )
+ {
+ mActualVisual->CreatePropertyMap( map );
+ }
+ else
+ {
+ map.Clear();
+ map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::WIREFRAME );
+ }
+}
+
void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
{
// no properties supported at the moment
actor.AddRenderer( mImpl->mRenderer );
}
-void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
-{
- map.Clear();
- map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::Visual::WIREFRAME );
-}
-
void WireframeVisual::InitializeRenderer()
{
Shader shader = mFactoryCache.GetShader( VisualFactoryCache::WIREFRAME_SHADER );
* @brief Create a new wireframe visual.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
- static WireframeVisualPtr New( VisualFactoryCache& factoryCache );
+ static WireframeVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
+
+ /**
+ * @brief Create a new wireframe visual with an encapsulated actual visual.
+ *
+ * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe
+ *
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] actualVisual The encapsulated actual visual.
+ * @return A smart-pointer to the newly allocated visual.
+ */
+ static WireframeVisualPtr New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual );
+
+ /**
+ * @brief Create a new wireframe visual with an encapsulated actual visual.
+ *
+ * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe
+ *
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] actualVisual The encapsulated actual visual.
+ * @param[in] properties A Property::Map containing settings for this visual
+ * @return A smart-pointer to the newly allocated visual.
+ */
+ static WireframeVisualPtr New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual, const Property::Map& properties );
+
protected:
* @brief Constructor.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] actualVisual The encapsulated actual visual.
*/
- WireframeVisual( VisualFactoryCache& factoryCache );
+ WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
virtual ~WireframeVisual();
+protected: // from Visual::Base
+
/**
- * @copydoc Visual::Base::DoSetProperties()
+ * @copydoc Visual::Base::GetHeightForWidth()
*/
- virtual void DoSetProperties( const Property::Map& propertyMap );
+ virtual float GetHeightForWidth( float width );
/**
- * @copydoc Visual::Base::DoSetOnStage
+ * @copydoc Visual::Base::GetNaturalSize()
*/
- virtual void DoSetOnStage( Actor& actor );
+ virtual void GetNaturalSize( Vector2& naturalSize );
/**
- * @copydoc Visual::Base::CreatePropertyMap
+ * @copydoc Visual::Base::CreatePropertyMap()
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
/**
+ * @copydoc Visual::Base::DoSetProperties()
+ */
+ virtual void DoSetProperties( const Property::Map& propertyMap );
+
+ /**
+ * @copydoc Visual::Base::DoSetOnStage
+ */
+ virtual void DoSetOnStage( Actor& actor );
+
+ /**
* @copydoc Visual::Base::OnSetTransform
*/
virtual void OnSetTransform();
*/
void InitializeRenderer();
-private:
-
// Undefined
WireframeVisual( const WireframeVisual& visual);
// Undefined
WireframeVisual& operator=( const WireframeVisual& visual );
+private:
+
+ Visual::BasePtr mActualVisual;
+
};
} // namespace Internal
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/size-negotiation/relayout-container.h>
#include <dali/devel-api/common/owner-container.h>
#include <dali/devel-api/object/handle-devel.h>
+#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_CONTROL_VISUALS");
#endif
+DALI_ENUM_TO_STRING_TABLE_BEGIN( CLIPPING_MODE )
+DALI_ENUM_TO_STRING_WITH_SCOPE( ClippingMode, DISABLED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( ClippingMode, CLIP_CHILDREN )
+DALI_ENUM_TO_STRING_TABLE_END( CLIPPING_MODE )
+
/**
* Struct used to store Visual within the control, index is a unique key for each visual.
*/
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::OnStageConnection number of registered visuals(%d)\n", mImpl->mVisuals.Size() );
+ Actor self( Self() );
+
for(RegisteredVisualContainer::Iterator iter = mImpl->mVisuals.Begin(); iter!= mImpl->mVisuals.End(); iter++)
{
// Check whether the visual is empty and enabled
if( (*iter)->visual && (*iter)->enabled )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::OnStageConnection Setting visual(%d) on stage\n", (*iter)->index );
- Actor self( Self() );
Toolkit::GetImplementation((*iter)->visual).SetOnStage( self );
}
}
+
+ if( mImpl->mVisuals.Empty() && ! self.GetRendererCount() )
+ {
+ Property::Value clippingValue = self.GetProperty( Actor::Property::CLIPPING_MODE );
+ int clippingMode = ClippingMode::DISABLED;
+ if( clippingValue.Get( clippingMode ) )
+ {
+ // Add a transparent background if we do not have any renderers or visuals so we clip our children
+
+ if( clippingMode == ClippingMode::CLIP_CHILDREN )
+ {
+ // Create a transparent background visual which will also get staged.
+ SetBackgroundColor( Color::TRANSPARENT );
+ }
+ }
+ }
}
void Control::OnStageDisconnection()
OnControlChildRemove( child );
}
+void Control::OnPropertySet( Property::Index index, Property::Value propertyValue )
+{
+ Actor self( Self() );
+ if( index == Actor::Property::CLIPPING_MODE )
+ {
+ // Only set the background if we're already on the stage and have no renderers or visuals
+
+ if( mImpl->mVisuals.Empty() && ! self.GetRendererCount() && self.OnStage() )
+ {
+ ClippingMode::Type clippingMode = ClippingMode::DISABLED;
+ if( Scripting::GetEnumerationProperty< ClippingMode::Type >( propertyValue, CLIPPING_MODE_TABLE, CLIPPING_MODE_TABLE_COUNT, clippingMode ) )
+ {
+ // Add a transparent background if we do not have one so we clip children
+
+ if( clippingMode == ClippingMode::CLIP_CHILDREN )
+ {
+ SetBackgroundColor( Color::TRANSPARENT );
+ }
+ }
+ }
+ }
+}
+
void Control::OnSizeSet(const Vector3& targetSize)
{
Toolkit::Visual::Base visual = GetVisual( Toolkit::Control::Property::BACKGROUND );
#define DALI_TOOLKIT_CONTROL_IMPL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* @copydoc CustomActorImpl::OnStageConnection()
- * @note If overridden, then an up-call to Control::OnStageConnection MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnStageConnection MUST be made at the end.
*/
virtual void OnStageConnection( int depth );
/**
* @copydoc CustomActorImpl::OnChildAdd()
- * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the end.
*/
virtual void OnChildAdd( Actor& child );
virtual void OnChildRemove( Actor& child );
/**
+ * @copydoc CustomActorImpl::OnPropertySet()
+ * @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
+ */
+ virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
+
+ /**
* @copydoc CustomActorImpl::OnSizeSet()
- * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the end.
*/
virtual void OnSizeSet( const Vector3& targetSize );
/**
* @copydoc CustomActorImpl::OnSizeAnimation()
- * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the start.
+ * @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the end.
*/
virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize );
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 19;
+const unsigned int TOOLKIT_MICRO_VERSION = 21;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* This file is part of Dali Toolkit
*
{
"progressValue": 0,
"trackVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin.9.png",
+ "url":"{DALI_IMAGE_DIR}progress-skin.9.png",
"size":[24,24]
},
"progressVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-progress.9.png",
+ "url":"{DALI_IMAGE_DIR}progress-skin-progress.9.png",
"size":[24,24]
}
},
{
"progressValue": 0,
"trackVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin.9.png",
+ "url":"{DALI_IMAGE_DIR}progress-skin.9.png",
"size":[24,24]
},
"progressVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-progress.9.png",
+ "url":"{DALI_IMAGE_DIR}progress-skin-progress.9.png",
"size":[24,24]
}
},
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* This file is part of Dali Toolkit
*
{
"progressValue": 0,
"trackVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin.9.png",
+ "url":"{DALI_IMAGE_DIR}progress-skin.9.png",
"size":[24,24]
},
"progressVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-progress.9.png",
+ "url":"{DALI_IMAGE_DIR}progress-skin-progress.9.png",
"size":[24,24]
}
},
// C++
void MyUIControlImpl::OnChildAdd( Actor& child );
{
- // Up call to Control first
- Control::OnChildAdd( child );
-
// Do any other operations required upon child addition
+
+ // Up call to Control at the end
+ Control::OnChildAdd( child );
}
~~~
~~~{.cpp}
// C++
void MyUIControlImpl::OnStageConnection( int depth )
{
- // Up call to Control first
- Control::OnStageConnection( depth );
-
// Do any other operations required upon stage connection
+
+ // Up call to Control at the end
+ Control::OnStageConnection( depth );
}
~~~
~~~{.cpp}
___________________________________________________________________________________________________
+### Clipping Support {#creating-controls-clipping}
+
+When an Actor is set to clip its children, the renderers have to be added manually in order to specify what its children need to clip to.
+The Control base class automates the creation of the renderers/visuals when it is set to clip its children.
+
+This is only done if the application or custom control writer has not added any renderers to the Control or registered any visuals
+(regardless of whether these visuals are enabled or not).
+
+If custom control writers want to define the clipping visuals themselves, then they should register all required visuals before the control is staged.
+
+___________________________________________________________________________________________________
+
### Other Features {#creating-controls-other}
+ [Background](@ref background)
Name: dali-addon
Summary: DALi module for Node.JS
-Version: 1.2.19
+Version: 1.2.21
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.19
+Version: 1.2.21
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
examples/spin-control.exe \
examples/control-dashboard.exe \
examples/user-alphafunction.exe \
+ examples/image-view.exe \
examples/libNDalic.so examples/NDali.dll
examples/%.exe: examples/%.cs
*/
%typemap(cscode) Dali::AlphaFunction %{
- public AlphaFunction(Dali.Constants.AlphaFunction.BuiltinFunction function) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_1((int)function), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
public AlphaFunction(System.Delegate func) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_2(SWIGTYPE_p_f_float__float.getCPtr(new SWIGTYPE_p_f_float__float(System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func), true))), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
%rename(BlendingEquationType) Dali::BlendingEquation::Type;
%rename(CameraType) Dali::Camera::Type;
%rename(LayerBehavior) Dali::Layer::Behavior;
-%rename(DaliEndAction) Dali::Animation::EndAction;
+%rename(X) Dali::Vector2::x;
+%rename(Y) Dali::Vector2::y;
+%rename(Width) Dali::Vector2::width;
+%rename(Height) Dali::Vector2::height;
+%rename(X) Dali::Vector3::x;
+%rename(Y) Dali::Vector3::y;
+%rename(Z) Dali::Vector3::z;
+%rename(Width) Dali::Vector3::width;
+%rename(Height) Dali::Vector3::height;
+%rename(Depth) Dali::Vector3::depth;
+%rename(X) Dali::Vector4::x;
+%rename(Y) Dali::Vector4::y;
+%rename(Z) Dali::Vector4::z;
+%rename(W) Dali::Vector4::w;
+
typedef std::pair<std::string, Dali::Property::Value> StringValuePair;
typedef std::vector<Dali::TouchPoint> TouchPointContainer;
%include events/videoview-event.i
%include alphafunction.i
+%include name-changed.i
%include dali-operator.i
%include dali-core.i
}
}
- public Dali.Constants.Animation.State Status
+ public Animation.State Status
{
get
{
- return (Dali.Constants.Animation.State)GetState();
+ return GetState();
}
}
}
}
- public Dali.Constants.Animation.EndAction EndAction
+ public Animation.EndActions EndAction
{
set
{
- switch(value)
- {
- case Dali.Constants.Animation.EndAction.Cancel :
- SetEndAction(Dali.Animation.DaliEndAction.Bake);
- break;
- case Dali.Constants.Animation.EndAction.Discard :
- SetEndAction(Dali.Animation.DaliEndAction.Discard);
- break;
- case Dali.Constants.Animation.EndAction.Stop :
- SetEndAction(Dali.Animation.DaliEndAction.BakeFinal);
- break;
- default :
- SetEndAction(Dali.Animation.DaliEndAction.Bake);
- break;
- }
+ SetEndAction(value);
}
get
{
- Dali.Animation.DaliEndAction temp = GetEndAction();
- switch(temp)
- {
- case Dali.Animation.DaliEndAction.Bake :
- return Dali.Constants.Animation.EndAction.Cancel;
- case Dali.Animation.DaliEndAction.Discard :
- return Dali.Constants.Animation.EndAction.Discard;
- case Dali.Animation.DaliEndAction.BakeFinal :
- return Dali.Constants.Animation.EndAction.Stop;
- default :
- return Dali.Constants.Animation.EndAction.Cancel;
- }
+ return GetEndAction();
}
}
- public void Stop(Dali.Constants.Animation.EndAction action) {
- switch( action )
- {
- case Dali.Constants.Animation.EndAction.Cancel :
- SetEndAction(Dali.Animation.DaliEndAction.Bake);
- break;
- case Dali.Constants.Animation.EndAction.Discard :
- SetEndAction(Dali.Animation.DaliEndAction.Discard);
- break;
- case Dali.Constants.Animation.EndAction.Stop :
- SetEndAction(Dali.Animation.DaliEndAction.BakeFinal);
- break;
- default :
- SetEndAction(Dali.Animation.DaliEndAction.Bake);
- break;
- }
+ public void Stop(Animation.EndActions action)
+ {
+ SetEndAction(action);
NDalicPINVOKE.Animation_Stop(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public int StartTime { set; get; }
public int EndTime { set; get; }
- public string TargetPoperty { set; get; }
+ public string TargetProperty { set; get; }
public object Destination { set; get; }
public Dali.AlphaFunction AlphaFunction { set; get; }
public void AnimateBy(Actor target)
{
- string _str1 = TargetPoperty.Substring(0, 1);
- string _str2 = TargetPoperty.Substring(1);
+ string _str1 = TargetProperty.Substring(0, 1);
+ string _str2 = TargetProperty.Substring(1);
string _str = _str1.ToLower() + _str2;
dynamic obj = (object)Destination;
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateBy(new Property(target, _str), new Property.Value(obj), this.AlphaFunction, time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateBy(new Property(target, _str), new Property.Value(obj), time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateBy(new Property(target, _str), new Property.Value(obj), this.AlphaFunction, time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateBy(new Property(target, _str), new Property.Value(obj), time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateBy(new Property(target, _str), new Property.Value(obj), this.AlphaFunction, time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateBy(new Property(target, _str), new Property.Value(obj), time );
}
}
public void AnimateTo(Actor target)
{
- string _str1 = TargetPoperty.Substring(0, 1);
- string _str2 = TargetPoperty.Substring(1);
+ string _str1 = TargetProperty.Substring(0, 1);
+ string _str2 = TargetProperty.Substring(1);
string _str = _str1.ToLower() + _str2;
dynamic obj = (object)Destination;
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateTo(new Property(target, _str), new Property.Value(obj), this.AlphaFunction, time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateTo(new Property(target, _str), new Property.Value(obj), time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateTo(new Property(target, _str), new Property.Value(obj), this.AlphaFunction, time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateTo(new Property(target, _str), new Property.Value(obj), time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateTo(new Property(target, _str), new Property.Value(obj), this.AlphaFunction, time );
}
}
}
else
{
- Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime ) );
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
AnimateTo(new Property(target, _str), new Property.Value(obj), time );
}
}
}
+ public void AnimateBetween(Actor target, KeyFrames keyFrames)
+ {
+ string _str1 = TargetProperty.Substring(0, 1);
+ string _str2 = TargetProperty.Substring(1);
+ string _str = _str1.ToLower() + _str2;
+
+
+ if( this.AlphaFunction != null )
+ {
+ if( this.StartTime == 0 && this.EndTime == 0 )
+ {
+ AnimateBetween(new Property(target, _str), keyFrames, this.AlphaFunction);
+ }
+ else
+ {
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
+ AnimateBetween(new Property(target, _str), keyFrames, this.AlphaFunction, time);
+ }
+ }
+ else
+ {
+ if( this.StartTime == 0 && this.EndTime == 0 )
+ {
+ AnimateBetween(new Property(target, _str), keyFrames);
+ }
+ else
+ {
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
+ AnimateBetween(new Property(target, _str), keyFrames, time);
+ }
+ }
+ }
+
+ public void AnimateBetween(Actor target, KeyFrames keyFrames, Animation.Interpolation interpolation)
+ {
+ string _str1 = TargetProperty.Substring(0, 1);
+ string _str2 = TargetProperty.Substring(1);
+ string _str = _str1.ToLower() + _str2;
+
+
+ if( this.AlphaFunction != null )
+ {
+ if( this.StartTime == 0 && this.EndTime == 0 )
+ {
+ AnimateBetween(new Property(target, _str), keyFrames, this.AlphaFunction, interpolation);
+ }
+ else
+ {
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
+ AnimateBetween(new Property(target, _str), keyFrames, this.AlphaFunction, time, interpolation);
+ }
+ }
+ else
+ {
+ if( this.StartTime == 0 && this.EndTime == 0 )
+ {
+ AnimateBetween(new Property(target, _str), keyFrames, interpolation);
+ }
+ else
+ {
+ Dali.TimePeriod time = new Dali.TimePeriod( MilliSecondsToSeconds( this.StartTime ), MilliSecondsToSeconds( this.EndTime - this.StartTime ) );
+ AnimateBetween(new Property(target, _str), keyFrames, time, interpolation);
+ }
+ }
+ }
+
+
/**
* @brief Create an initialized Animation.
*
namespace Dali
{
DALI_animation_EVENTHANDLER_PARAM( Dali, Animation);
+
+%typemap(cscode) Dali::KeyFrames %{
+
+ public void Add(float progress, object value)
+ {
+ dynamic obj = value;
+ Add(progress, new Property.Value(obj));
+ }
+
+ public void Add(float progress, object value, AlphaFunction alpha)
+ {
+ dynamic obj = value;
+ Add(progress, new Property.Value(obj), alpha);
+ }
+
+%}
+
}
using System.Runtime.InteropServices;
/**
- * @brief Event arguments that passed via AUIApplicationInit signal
+ * @brief Event arguments that passed via NUIApplicationInit signal
*
*/
- public class AUIApplicationInitEventArgs : EventArgs
+ public class NUIApplicationInitEventArgs : EventArgs
{
private Application _application;
}
/**
- * @brief Event arguments that passed via AUIApplicationTerminate signal
+ * @brief Event arguments that passed via NUIApplicationTerminate signal
*
*/
- public class AUIApplicationTerminateEventArgs : EventArgs
+ public class NUIApplicationTerminateEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationPause signal
+ * @brief Event arguments that passed via NUIApplicationPause signal
*
*/
- public class AUIApplicationPauseEventArgs : EventArgs
+ public class NUIApplicationPauseEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationResume signal
+ * @brief Event arguments that passed via NUIApplicationResume signal
*
*/
- public class AUIApplicationResumeEventArgs : EventArgs
+ public class NUIApplicationResumeEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationReset signal
+ * @brief Event arguments that passed via NUIApplicationReset signal
*
*/
- public class AUIApplicationResetEventArgs : EventArgs
+ public class NUIApplicationResetEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationResize signal
+ * @brief Event arguments that passed via NUIApplicationResize signal
*
*/
- public class AUIApplicationResizeEventArgs : EventArgs
+ public class NUIApplicationResizeEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationLanguageChanged signal
+ * @brief Event arguments that passed via NUIApplicationLanguageChanged signal
*
*/
- public class AUIApplicationLanguageChangedEventArgs : EventArgs
+ public class NUIApplicationLanguageChangedEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationRegionChanged signal
+ * @brief Event arguments that passed via NUIApplicationRegionChanged signal
*
*/
- public class AUIApplicationRegionChangedEventArgs : EventArgs
+ public class NUIApplicationRegionChangedEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationBatteryLow signal
+ * @brief Event arguments that passed via NUIApplicationBatteryLow signal
*
*/
- public class AUIApplicationBatteryLowEventArgs : EventArgs
+ public class NUIApplicationBatteryLowEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationMemoryLow signal
+ * @brief Event arguments that passed via NUIApplicationMemoryLow signal
*
*/
- public class AUIApplicationMemoryLowEventArgs : EventArgs
+ public class NUIApplicationMemoryLowEventArgs : EventArgs
{
private Application _application;
/**
}
/**
- * @brief Event arguments that passed via AUIApplicationAppControl signal
+ * @brief Event arguments that passed via NUIApplicationAppControl signal
*
*/
- public class AUIApplicationAppControlEventArgs : EventArgs
+ public class NUIApplicationAppControlEventArgs : EventArgs
{
private Application _application;
private IntPtr _voidp;
%define APPLICATION_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
%typemap(cscode) NameSpace::ClassName %{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationInitEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationInitEventArgs> _applicationInitEventHandler;
- private AUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
+ private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationInitEventArgs> _applicationInitEventHandler;
+ private NUIApplicationInitEventCallbackDelegate _applicationInitEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationTerminateEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationTerminateEventArgs> _applicationTerminateEventHandler;
- private AUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
+ private delegate void NUIApplicationTerminateEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationTerminateEventArgs> _applicationTerminateEventHandler;
+ private NUIApplicationTerminateEventCallbackDelegate _applicationTerminateEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationPauseEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationPauseEventArgs> _applicationPauseEventHandler;
- private AUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
+ private delegate void NUIApplicationPauseEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationPauseEventArgs> _applicationPauseEventHandler;
+ private NUIApplicationPauseEventCallbackDelegate _applicationPauseEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationResumeEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationResumeEventArgs> _applicationResumeEventHandler;
- private AUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
+ private delegate void NUIApplicationResumeEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationResumeEventArgs> _applicationResumeEventHandler;
+ private NUIApplicationResumeEventCallbackDelegate _applicationResumeEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationResetEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationResetEventArgs> _applicationResetEventHandler;
- private AUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
+ private delegate void NUIApplicationResetEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationResetEventArgs> _applicationResetEventHandler;
+ private NUIApplicationResetEventCallbackDelegate _applicationResetEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationResizeEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationResizeEventArgs> _applicationResizeEventHandler;
- private AUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
+ private delegate void NUIApplicationResizeEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationResizeEventArgs> _applicationResizeEventHandler;
+ private NUIApplicationResizeEventCallbackDelegate _applicationResizeEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
- private AUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
+ private delegate void NUIApplicationLanguageChangedEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs> _applicationLanguageChangedEventHandler;
+ private NUIApplicationLanguageChangedEventCallbackDelegate _applicationLanguageChangedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
- private AUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
+ private delegate void NUIApplicationRegionChangedEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationRegionChangedEventArgs> _applicationRegionChangedEventHandler;
+ private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationBatteryLowEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
- private AUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
+ private delegate void NUIApplicationBatteryLowEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationBatteryLowEventArgs> _applicationBatteryLowEventHandler;
+ private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationMemoryLowEventCallbackDelegate(IntPtr application);
- private DaliEventHandler<object,AUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
- private AUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
+ private delegate void NUIApplicationMemoryLowEventCallbackDelegate(IntPtr application);
+ private DaliEventHandler<object,NUIApplicationMemoryLowEventArgs> _applicationMemoryLowEventHandler;
+ private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void AUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
- private DaliEventHandler<object,AUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
- private AUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
+ private delegate void NUIApplicationAppControlEventCallbackDelegate(IntPtr application, IntPtr voidp);
+ private DaliEventHandler<object,NUIApplicationAppControlEventArgs> _applicationAppControlEventHandler;
+ private NUIApplicationAppControlEventCallbackDelegate _applicationAppControlEventCallbackDelegate;
/**
* @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationInitEventHandler - DaliEventHandler<object,AUIApplicationInitEventArgs>)
+ * (in the type of NUIApplicationInitEventHandler - DaliEventHandler<object,NUIApplicationInitEventArgs>)
* provided by the user. Initialized signal is emitted when application is initialised
*/
- public event DaliEventHandler<object,AUIApplicationInitEventArgs> Initialized
+ public event DaliEventHandler<object,NUIApplicationInitEventArgs> Initialized
{
add
{
{
_applicationInitEventHandler += value;
- _applicationInitEventCallbackDelegate = new AUIApplicationInitEventCallbackDelegate(OnApplicationInit);
+ _applicationInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationInit);
this.InitSignal().Connect(_applicationInitEventCallbackDelegate);
}
}
// Callback for Application InitSignal
private void OnApplicationInit(IntPtr data)
{
- AUIApplicationInitEventArgs e = new AUIApplicationInitEventArgs();
+ NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
- // Populate all members of "e" (AUIApplicationInitEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationInitEventHandler != null)
/**
* @brief Event for Terminated signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationTerminateEventHandler-DaliEventHandler<object,AUIApplicationTerminateEventArgs>)
+ * (in the type of NUIApplicationTerminateEventHandler-DaliEventHandler<object,NUIApplicationTerminateEventArgs>)
* provided by the user. Terminated signal is emitted when application is terminated
*/
- public event DaliEventHandler<object,AUIApplicationTerminateEventArgs> Terminated
+ public event DaliEventHandler<object,NUIApplicationTerminateEventArgs> Terminated
{
add
{
{
_applicationTerminateEventHandler += value;
- _applicationTerminateEventCallbackDelegate = new AUIApplicationTerminateEventCallbackDelegate(OnAUIApplicationTerminate);
+ _applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate);
this.TerminateSignal().Connect(_applicationTerminateEventCallbackDelegate);
}
}
}
// Callback for Application TerminateSignal
- private void OnAUIApplicationTerminate(IntPtr data)
+ private void OnNUIApplicationTerminate(IntPtr data)
{
- AUIApplicationTerminateEventArgs e = new AUIApplicationTerminateEventArgs();
+ NUIApplicationTerminateEventArgs e = new NUIApplicationTerminateEventArgs();
- // Populate all members of "e" (AUIApplicationTerminateEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationTerminateEventHandler != null)
/**
* @brief Event for Paused signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationPauseEventHandler-DaliEventHandler<object,AUIApplicationPauseEventArgs>)
+ * (in the type of NUIApplicationPauseEventHandler-DaliEventHandler<object,NUIApplicationPauseEventArgs>)
* provided by the user. Paused signal is emitted when application is paused
*/
- public event DaliEventHandler<object,AUIApplicationPauseEventArgs> Paused
+ public event DaliEventHandler<object,NUIApplicationPauseEventArgs> Paused
{
add
{
{
_applicationPauseEventHandler += value;
- _applicationPauseEventCallbackDelegate = new AUIApplicationPauseEventCallbackDelegate(OnAUIApplicationPause);
+ _applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause);
this.PauseSignal().Connect(_applicationPauseEventCallbackDelegate);
}
}
}
// Callback for Application PauseSignal
- private void OnAUIApplicationPause(IntPtr data)
+ private void OnNUIApplicationPause(IntPtr data)
{
- AUIApplicationPauseEventArgs e = new AUIApplicationPauseEventArgs();
+ NUIApplicationPauseEventArgs e = new NUIApplicationPauseEventArgs();
- // Populate all members of "e" (AUIApplicationPauseEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationPauseEventHandler != null)
/**
* @brief Event for Resumed signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationResumeEventHandler-DaliEventHandler<object,AUIApplicationResumeEventArgs>)
+ * (in the type of NUIApplicationResumeEventHandler-DaliEventHandler<object,NUIApplicationResumeEventArgs>)
* provided by the user. Resumed signal is emitted when application is resumed
*/
- public event DaliEventHandler<object,AUIApplicationResumeEventArgs> Resumed
+ public event DaliEventHandler<object,NUIApplicationResumeEventArgs> Resumed
{
add
{
{
_applicationResumeEventHandler += value;
- _applicationResumeEventCallbackDelegate = new AUIApplicationResumeEventCallbackDelegate(OnAUIApplicationResume);
+ _applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume);
this.ResumeSignal().Connect(_applicationResumeEventCallbackDelegate);
}
}
}
// Callback for Application ResumeSignal
- private void OnAUIApplicationResume(IntPtr data)
+ private void OnNUIApplicationResume(IntPtr data)
{
- AUIApplicationResumeEventArgs e = new AUIApplicationResumeEventArgs();
+ NUIApplicationResumeEventArgs e = new NUIApplicationResumeEventArgs();
- // Populate all members of "e" (AUIApplicationResumeEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationResumeEventHandler != null)
/**
* @brief Event for Reset signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationResetEventHandler-DaliEventHandler<object,AUIApplicationResetEventArgs>)
+ * (in the type of NUIApplicationResetEventHandler-DaliEventHandler<object,NUIApplicationResetEventArgs>)
* provided by the user. Reset signal is emitted when application is reset
*/
- public event DaliEventHandler<object,AUIApplicationResetEventArgs> Reset
+ public event DaliEventHandler<object,NUIApplicationResetEventArgs> Reset
{
add
{
{
_applicationResetEventHandler += value;
- _applicationResetEventCallbackDelegate = new AUIApplicationResetEventCallbackDelegate(OnAUIApplicationReset);
+ _applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset);
this.ResetSignal().Connect(_applicationResetEventCallbackDelegate);
}
}
}
// Callback for Application ResetSignal
- private void OnAUIApplicationReset(IntPtr data)
+ private void OnNUIApplicationReset(IntPtr data)
{
- AUIApplicationResetEventArgs e = new AUIApplicationResetEventArgs();
+ NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs();
- // Populate all members of "e" (AUIApplicationResetEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationResetEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationResetEventHandler != null)
/**
* @brief Event for Resized signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationResizeEventHandler-DaliEventHandler<object,AUIApplicationResizeEventArgs>)
+ * (in the type of NUIApplicationResizeEventHandler-DaliEventHandler<object,NUIApplicationResizeEventArgs>)
* provided by the user. Resized signal is emitted when application is resized
*/
- public event DaliEventHandler<object,AUIApplicationResizeEventArgs> Resized
+ public event DaliEventHandler<object,NUIApplicationResizeEventArgs> Resized
{
add
{
{
_applicationResizeEventHandler += value;
- _applicationResizeEventCallbackDelegate = new AUIApplicationResizeEventCallbackDelegate(OnAUIApplicationResize);
+ _applicationResizeEventCallbackDelegate = new NUIApplicationResizeEventCallbackDelegate(OnNUIApplicationResize);
this.ResizeSignal().Connect(_applicationResizeEventCallbackDelegate);
}
}
}
// Callback for Application ResizeSignal
- private void OnAUIApplicationResize(IntPtr data)
+ private void OnNUIApplicationResize(IntPtr data)
{
- AUIApplicationResizeEventArgs e = new AUIApplicationResizeEventArgs();
+ NUIApplicationResizeEventArgs e = new NUIApplicationResizeEventArgs();
- // Populate all members of "e" (AUIApplicationResizeEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationResizeEventHandler != null)
/**
* @brief Event for LanguageChanged signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationLanguageChangedEventHandler-DaliEventHandler<object,AUIApplicationLanguageChangedEventArgs>)
+ * (in the type of NUIApplicationLanguageChangedEventHandler-DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs>)
* provided by the user. LanguageChanged signal is emitted when the region of the device is changed.
*/
- public event DaliEventHandler<object,AUIApplicationLanguageChangedEventArgs> LanguageChanged
+ public event DaliEventHandler<object,NUIApplicationLanguageChangedEventArgs> LanguageChanged
{
add
{
{
_applicationLanguageChangedEventHandler += value;
- _applicationLanguageChangedEventCallbackDelegate = new AUIApplicationLanguageChangedEventCallbackDelegate(OnAUIApplicationLanguageChanged);
+ _applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged);
this.LanguageChangedSignal().Connect(_applicationLanguageChangedEventCallbackDelegate);
}
}
}
// Callback for Application LanguageChangedSignal
- private void OnAUIApplicationLanguageChanged(IntPtr data)
+ private void OnNUIApplicationLanguageChanged(IntPtr data)
{
- AUIApplicationLanguageChangedEventArgs e = new AUIApplicationLanguageChangedEventArgs();
+ NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs();
- // Populate all members of "e" (AUIApplicationLanguageChangedEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationLanguageChangedEventHandler != null)
/**
* @brief Event for RegionChanged signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationRegionChangedEventHandler-DaliEventHandler<object,AUIApplicationRegionChangedEventArgs>)
+ * (in the type of NUIApplicationRegionChangedEventHandler-DaliEventHandler<object,NUIApplicationRegionChangedEventArgs>)
* provided by the user. RegionChanged signal is emitted when the region of the device is changed.
*/
- public event DaliEventHandler<object,AUIApplicationRegionChangedEventArgs> RegionChanged
+ public event DaliEventHandler<object,NUIApplicationRegionChangedEventArgs> RegionChanged
{
add
{
{
_applicationRegionChangedEventHandler += value;
- _applicationRegionChangedEventCallbackDelegate = new AUIApplicationRegionChangedEventCallbackDelegate(OnAUIApplicationRegionChanged);
+ _applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged);
this.RegionChangedSignal().Connect(_applicationRegionChangedEventCallbackDelegate);
}
}
}
// Callback for Application RegionChangedSignal
- private void OnAUIApplicationRegionChanged(IntPtr data)
+ private void OnNUIApplicationRegionChanged(IntPtr data)
{
- AUIApplicationRegionChangedEventArgs e = new AUIApplicationRegionChangedEventArgs();
+ NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs();
- // Populate all members of "e" (AUIApplicationRegionChangedEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationRegionChangedEventHandler != null)
/**
* @brief Event for BatteryLow signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationBatteryLowEventHandler-DaliEventHandler<object,AUIApplicationBatteryLowEventArgs>)
+ * (in the type of NUIApplicationBatteryLowEventHandler-DaliEventHandler<object,NUIApplicationBatteryLowEventArgs>)
* provided by the user. BatteryLow signal is emitted when the battery level of the device is low.
*/
- public event DaliEventHandler<object,AUIApplicationBatteryLowEventArgs> BatteryLow
+ public event DaliEventHandler<object,NUIApplicationBatteryLowEventArgs> BatteryLow
{
add
{
{
_applicationBatteryLowEventHandler += value;
- _applicationBatteryLowEventCallbackDelegate = new AUIApplicationBatteryLowEventCallbackDelegate(OnAUIApplicationBatteryLow);
+ _applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow);
this.BatteryLowSignal().Connect(_applicationBatteryLowEventCallbackDelegate);
}
}
}
// Callback for Application BatteryLowSignal
- private void OnAUIApplicationBatteryLow(IntPtr data)
+ private void OnNUIApplicationBatteryLow(IntPtr data)
{
- AUIApplicationBatteryLowEventArgs e = new AUIApplicationBatteryLowEventArgs();
+ NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs();
- // Populate all members of "e" (AUIApplicationBatteryLowEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationBatteryLowEventHandler != null)
/**
* @brief Event for MemoryLow signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationMemoryLowEventHandler-DaliEventHandler<object,AUIApplicationMemoryLowEventArgs>)
+ * (in the type of NUIApplicationMemoryLowEventHandler-DaliEventHandler<object,NUIApplicationMemoryLowEventArgs>)
* provided by the user. MemoryLow signal is emitted when the memory level of the device is low.
*/
- public event DaliEventHandler<object,AUIApplicationMemoryLowEventArgs> MemoryLow
+ public event DaliEventHandler<object,NUIApplicationMemoryLowEventArgs> MemoryLow
{
add
{
{
_applicationMemoryLowEventHandler += value;
- _applicationMemoryLowEventCallbackDelegate = new AUIApplicationMemoryLowEventCallbackDelegate(OnAUIApplicationMemoryLow);
+ _applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow);
this.MemoryLowSignal().Connect(_applicationMemoryLowEventCallbackDelegate);
}
}
}
// Callback for Application MemoryLowSignal
- private void OnAUIApplicationMemoryLow(IntPtr data)
+ private void OnNUIApplicationMemoryLow(IntPtr data)
{
- AUIApplicationMemoryLowEventArgs e = new AUIApplicationMemoryLowEventArgs();
+ NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs();
- // Populate all members of "e" (AUIApplicationMemoryLowEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
if (_applicationMemoryLowEventHandler != null)
/**
* @brief Event for AppControl signal which can be used to subscribe/unsubscribe the event handler
- * (in the type of AUIApplicationAppControlEventHandler-DaliEventHandler<object,AUIApplicationAppControlEventArgs>)
+ * (in the type of NUIApplicationAppControlEventHandler-DaliEventHandler<object,NUIApplicationAppControlEventArgs>)
* provided by the user. AppControl signal is emitted when another application sends a launch request to the application.
*/
- public event DaliEventHandler<object,AUIApplicationAppControlEventArgs> AppControl
+ public event DaliEventHandler<object,NUIApplicationAppControlEventArgs> AppControl
{
add
{
{
_applicationAppControlEventHandler += value;
- _applicationAppControlEventCallbackDelegate = new AUIApplicationAppControlEventCallbackDelegate(OnAUIApplicationAppControl);
+ _applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl);
this.AppControlSignal().Connect(_applicationAppControlEventCallbackDelegate);
}
}
}
// Callback for Application AppControlSignal
- private void OnAUIApplicationAppControl(IntPtr application, IntPtr voidp)
+ private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp)
{
- AUIApplicationAppControlEventArgs e = new AUIApplicationAppControlEventArgs();
+ NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs();
- // Populate all members of "e" (AUIApplicationAppControlEventArgs) with real data
+ // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(application);
e.VoidP = voidp;
}
}
+ private static readonly Stage instance = Stage.GetCurrent();
+
+ public static Stage Instance
+ {
+ get
+ {
+ return instance;
+ }
+ }
+
+ public Layer GetDefaultLayer()
+ {
+ return this.GetRootLayer();
+ }
+
+ public void AddLayer(Layer layer)
+ {
+ this.Add( (Actor)layer );
+ }
+
+ public void RemoveLayer(Layer layer)
+ {
+ this.Remove( (Actor)layer );
+ }
+
+
%}
%enddef
--- /dev/null
+%rename( EndActions ) Dali::Animation::EndAction;
+%rename( Cancel ) Dali::Animation::Bake;
+%rename( StopFinal ) Dali::Animation::BakeFinal;
+%rename( Stopped ) Dali::Animation::STOPPED;
+%rename( Playing ) Dali::Animation::PLAYING;
+%rename( Paused ) Dali::Animation::PAUSED;
+
+%rename( Default ) Dali::AlphaFunction::DEFAULT;
+%rename( Linear ) Dali::AlphaFunction::LINEAR;
+%rename( Reverse ) Dali::AlphaFunction::REVERSE;
+%rename( EaseInSquare ) Dali::AlphaFunction::EASE_IN_SQUARE;
+%rename( EaseOutSquare ) Dali::AlphaFunction::EASE_OUT_SQUARE;
+%rename( EaseIn ) Dali::AlphaFunction::EASE_IN;
+%rename( EaseOut ) Dali::AlphaFunction::EASE_OUT;
+%rename( EaseInOut ) Dali::AlphaFunction::EASE_IN_OUT;
+%rename( EaseInSine ) Dali::AlphaFunction::EASE_IN_SINE;
+%rename( EaseOutSine) Dali::AlphaFunction::EASE_OUT_SINE;
+%rename( EaseInOutSine ) Dali::AlphaFunction::EASE_IN_OUT_SINE;
+%rename( Bounce ) Dali::AlphaFunction::BOUNCE;
+%rename( Sin ) Dali::AlphaFunction::SIN;
+%rename( EaseOutBack) Dali::AlphaFunction::EASE_OUT_BACK;
+%rename( Count) Dali::AlphaFunction::COUNT;
+%rename( BuiltinFunction ) Dali::AlphaFunction::BUILTIN_FUNCTION;
+%rename( CustomFunction ) Dali::AlphaFunction::CUSTOM_FUNCTION;
+%rename( Bezier ) Dali::AlphaFunction::BEZIER;
+
_application.Initialized += OnInitialize;
}
- public void OnInitialize(object source, AUIApplicationInitEventArgs e)
+ public void OnInitialize(object source, NUIApplicationInitEventArgs e)
{
Console.WriteLine("Customized Application Initialize event handler");
_stage = Stage.GetCurrent();
{
// Make label for item
TextLabel itemLabel = new TextLabel(" " + item.name);
- itemLabel.Size = new Vector3(_stage.GetSize().width * 0.2f, _stage.GetSize().height * 0.05f, 0.0f);
+ itemLabel.Size = new Vector3(_stage.GetSize().Width * 0.2f, _stage.GetSize().Height * 0.05f, 0.0f);
itemLabel.HorizontalAlignment = "BEGIN";
itemLabel.VerticalAlignment = "BOTTOM";
itemLabel.PointSize = 18.0f;
else
{
ImageView notSupportView = new ImageView("images/not_yet_sign.png");
- notSupportView.Size = new Vector3(_stage.GetSize().width * 0.2f, _stage.GetSize().height * 0.25f, 0.0f);
+ notSupportView.Size = new Vector3(_stage.GetSize().Width * 0.2f, _stage.GetSize().Height * 0.25f, 0.0f);
notSupportView.SetKeyboardFocusable(true);
_contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
}
case Gesture.State.Continuing:
{
// Calculate the rating according to pan desture displacement
- _gestureDisplacement.x += gesture.displacement.x;
- int delta = (int)Math.Ceiling(_gestureDisplacement.x / 40.0f);
+ _gestureDisplacement.X += gesture.displacement.X;
+ int delta = (int)Math.Ceiling(_gestureDisplacement.X / 40.0f);
_currentValue = _myRating + delta;
// Clamp the rating
_application.Initialized += Initialize;
}
- public void Initialize(object source, AUIApplicationInitEventArgs e)
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
{
Stage stage = Stage.GetCurrent();
stage.BackgroundColor = Color.White;
Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
}
- public void Initialize(object source, AUIApplicationInitEventArgs e)
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
{
OperatorTests();
actor.Name = "MyActor";
actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f);
Console.WriteLine("Actor id: {0}", actor.GetId());
- Console.WriteLine("Actor size: " + actor.Size.x + ", " + actor.Size.y);
+ Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
Console.WriteLine("Actor name: " + actor.Name);
Stage stage = Stage.GetCurrent();
_application.Initialized += Initialize;
}
- public void Initialize(object source, AUIApplicationInitEventArgs e)
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
{
Console.WriteLine("Customized Application Initialize event handler");
- Stage stage = Stage.GetCurrent();
- stage.BackgroundColor = Color.Cyan;
+ Stage stage = Stage.Instance;
+ stage.BackgroundColor = Color.White;
stage.TouchEvent += OnStageTouched;
- stage.WheelEvent += OnStageWheelMoved;
- stage.KeyEvent += OnStageKeyPressed;
- stage.EventProcessingFinished += OnStageEventProcessingFinished;
// Add a _text label to the stage
_text = new TextLabel("Hello Mono World");
// Callback for _animation finished signal handling
public void AnimationFinished(object sender, EventArgs e)
{
- Console.WriteLine("AnimationFinished()!");
- }
-
- // Callback for _animation finished signal handling
- public void AnimationFinished2(object sender, EventArgs e)
- {
- Console.WriteLine("AnimationFinished2()!");
+ Console.WriteLine("AnimationFinished()!");
if(_animation)
{
Console.WriteLine("Duration= " + _animation.Duration);
}
}
- public void OnStageEventProcessingFinished(object sender, EventArgs e)
- {
- Console.WriteLine("OnStageEventProcessingFinished()!");
- if( e != null)
- {
- Console.WriteLine("e != null !");
- }
- }
-
- public void OnStageKeyPressed(object sender, Stage.KeyEventArgs e)
- {
- Console.WriteLine("OnStageKeyEventOccured()!");
- Console.WriteLine("keyPressedName=" + e.KeyEvent.keyPressedName);
- Console.WriteLine("state=" + e.KeyEvent.state);
- }
-
- public void OnStageWheelMoved(object sender, Stage.WheelEventArgs e)
- {
- Console.WriteLine("OnStageWheelEventOccured()!");
- Console.WriteLine("direction=" + e.WheelEvent.direction);
- Console.WriteLine("type=" + e.WheelEvent.type);
- }
-
// Callback for stage touched signal handling
public void OnStageTouched(object sender, Stage.TouchEventArgs e)
{
Duration = 2000,
StartTime = 0,
EndTime = 500,
- TargetPoperty = "Orientation",
+ TargetProperty = "Orientation",
Destination = new Quaternion( new Radian( new Degree( 180.0f ) ), Vect3.Xaxis)
};
_animation.AnimateTo(_text);
_animation.StartTime = 500;
_animation.EndTime = 1000;
- _animation.TargetPoperty = "Orientation";
+ _animation.TargetProperty = "Orientation";
_animation.Destination = new Quaternion( new Radian( new Degree( 0.0f ) ), Vect3.Xaxis );
_animation.AnimateTo(_text);
_animation.StartTime = 1000;
_animation.EndTime = 1500;
- _animation.TargetPoperty = "ScaleX";
+ _animation.TargetProperty = "ScaleX";
_animation.Destination = 3.0f;
_animation.AnimateBy(_text);
_animation.StartTime = 1500;
_animation.EndTime = 2000;
- _animation.TargetPoperty = "ScaleY";
+ _animation.TargetProperty = "ScaleY";
_animation.Destination = 4.0f;
_animation.AnimateBy(_text);
- _animation.EndAction = Dali.Constants.Animation.EndAction.Discard;
+ _animation.EndAction = Animation.EndActions.Discard;
// Connect the signal callback for animaiton finished signal
_animation.Finished += AnimationFinished;
- _animation.Finished += AnimationFinished2;
// Play the _animation
_animation.Play();
--- /dev/null
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+using System;
+using System.Runtime.InteropServices;
+using Dali;
+using Dali.Constants;
+
+namespace ImageViewExample
+{
+
+ class Example
+ {
+ public static void Log(string str)
+ {
+ Console.WriteLine("[DALI C# SAMPLE] " + str);
+ }
+
+ private Dali.Application _application;
+ private Animation _animation;
+ private ImageView _imageView;
+ private bool _isAniFinised = true;
+ private Layer layer, _layer1, _layer2;
+ private PushButton _pushButton1, _pushButton2;
+ private Stage stage;
+
+ public Example(Dali.Application application)
+ {
+ _application = application;
+ _application.Initialized += Initialize;
+ }
+
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
+ {
+ Log("Customized Application Initialize event handler");
+ stage = Stage.Instance;
+ stage.BackgroundColor = Color.Cyan;
+ stage.TouchEvent += OnStageTouched;
+ stage.WheelEvent += OnStageWheelMoved;
+ stage.KeyEvent += OnStageKeyPressed;
+ //stage.EventProcessingFinished += OnStageEventProcessingFinished;
+
+ layer = stage.GetDefaultLayer();
+ _layer1 = new Layer();
+ _layer2 = new Layer();
+ stage.AddLayer(_layer1);
+ stage.AddLayer(_layer2);
+ Log("_layer1.Behavior =" + _layer1.Behavior );
+ if( _layer1.Behavior == Layer.LayerBehavior.LAYER_UI )
+ {
+ _layer1.Behavior = Layer.LayerBehavior.LAYER_2D;
+ Log("again _layer1.Behavior =" + _layer1.Behavior );
+ }
+ // Add a ImageView to the stage
+ _imageView = new ImageView();
+ _imageView.ResourceUrl = "./images/gallery-3.jpg";
+ _imageView.ParentOrigin = ParentOrigin.Center;
+ _imageView.AnchorPoint = AnchorPoint.Center;
+ _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
+ //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
+ layer.Add(_imageView);
+
+ _pushButton1 = new PushButton();
+ _pushButton1.ParentOrigin = ParentOrigin.BottomLeft;
+ _pushButton1.AnchorPoint = AnchorPoint.BottomLeft;
+ _pushButton1.LabelText = "start animation";
+ _pushButton1.Position = new Vector3(0.0f, stage.Size.Height * 0.1f, 0.0f);
+ _pushButton1.Clicked += OnPushButtonClicked1;
+ _layer1.Add(_pushButton1);
+
+ _pushButton2 = new PushButton();
+ _pushButton2.ParentOrigin = ParentOrigin.BottomLeft;
+ _pushButton2.AnchorPoint = AnchorPoint.BottomLeft;
+ _pushButton2.LabelText = "reload image with same URL";
+ _pushButton2.Position = new Vector3(0.0f, stage.Size.Height * 0.2f, 0.0f);
+ _pushButton2.Clicked += OnPushButtonClicked2;
+ _layer2.Add(_pushButton2);
+
+ }
+
+ public bool OnPushButtonClicked2(object sender, Button.ClickedEventArgs e)
+ {
+ if( _imageView )
+ {
+ Log("OnPushButtonClicked2()!");
+ layer.Remove(_imageView);
+ _imageView = new ImageView();
+ _imageView.ResourceUrl = "./images/gallery-3.jpg";
+ _imageView.ParentOrigin = ParentOrigin.Center;
+ _imageView.AnchorPoint = AnchorPoint.Center;
+ _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
+ //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
+ layer.Add(_imageView);
+ }
+
+ return true;
+ }
+
+
+ public bool OnPushButtonClicked1(object sender, Button.ClickedEventArgs e)
+ {
+ if( _isAniFinised == true )
+ {
+ _isAniFinised = false;
+ Log("OnPushButtonClicked1()!");
+
+ // Create a new _animation
+ if( _animation )
+ {
+ //_animation.Stop(Dali.Constants.Animation.EndAction.Stop);
+ _animation.Reset();
+ }
+
+ _animation = new Animation();
+ _animation.StartTime = 0;
+ _animation.EndTime = 1000;
+ _animation.TargetProperty = "PixelArea";
+ _animation.Destination = new Vector4(0.5f, 0.0f, 0.5f, 0.5f);
+ _animation.AnimateTo(_imageView);
+
+ _animation.StartTime = 1000;
+ _animation.EndTime = 2000;
+ _animation.TargetProperty = "PixelArea";
+ _animation.Destination = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
+ _animation.AnimateTo(_imageView);
+
+ _animation.StartTime = 2000;
+ _animation.EndTime = 3000;
+ _animation.TargetProperty = "PixelArea";
+ _animation.Destination = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
+ _animation.AnimateTo(_imageView);
+
+ _animation.StartTime = 3000;
+ _animation.EndTime = 4000;
+ _animation.TargetProperty = "PixelArea";
+ _animation.Destination = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
+ _animation.AnimateTo(_imageView);
+
+ _animation.StartTime = 4000;
+ _animation.EndTime = 6000;
+ _animation.TargetProperty = "Size";
+ KeyFrames _keyFrames = new KeyFrames();
+ _keyFrames.Add(0.0f, new Size3D(0.0f, 0.0f, 0.0f) );
+ _keyFrames.Add(0.3f, new Size3D( (stage.Size * 0.7f) ) );
+ _keyFrames.Add(1.0f, new Size3D( stage.Size ) );
+ _animation.AnimateBetween(_imageView, _keyFrames, Animation.Interpolation.Linear);
+
+ _animation.EndAction = Animation.EndActions.Discard;
+
+ // Connect the signal callback for animaiton finished signal
+ _animation.Finished += AnimationFinished;
+ _animation.Finished += AnimationFinished2;
+
+ // Play the _animation
+ _animation.Play();
+ }
+
+ return true;
+ }
+
+ // Callback for _animation finished signal handling
+ public void AnimationFinished(object sender, EventArgs e)
+ {
+ Log("AnimationFinished()!");
+ }
+
+ // Callback for second _animation finished signal handling
+ public void AnimationFinished2(object sender, EventArgs e)
+ {
+ Log("AnimationFinished2()!");
+ if(_animation)
+ {
+ Log("Duration= " + _animation.Duration);
+ Log("EndAction= " + _animation.EndAction);
+ _isAniFinised = true;
+ }
+ }
+
+ public void OnStageEventProcessingFinished(object sender, EventArgs e)
+ {
+ Log("OnStageEventProcessingFinished()!");
+ if( e != null)
+ {
+ Log("e != null !");
+ }
+ }
+
+ public void OnStageKeyPressed(object sender, Stage.KeyEventArgs e)
+ {
+ Log("OnStageKeyEventOccured()!");
+ Log("keyPressedName=" + e.KeyEvent.keyPressedName);
+ Log("state=" + e.KeyEvent.state);
+ }
+
+ public void OnStageWheelMoved(object sender, Stage.WheelEventArgs e)
+ {
+ Log("OnStageWheelEventOccured()!");
+ Log("direction=" + e.WheelEvent.direction);
+ Log("type=" + e.WheelEvent.type);
+ }
+
+ // Callback for stage touched signal handling
+ public void OnStageTouched(object sender, Stage.TouchEventArgs e)
+ {
+ Log("OnStageTouched()! e.TouchData.GetState(0)=" + e.TouchData.GetState(0) );
+ }
+
+ public void MainLoop()
+ {
+ _application.MainLoop ();
+ }
+
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main(string[] args)
+ {
+ Log("Main() called!");
+
+ Example example = new Example(Application.NewApplication());
+ example.MainLoop ();
+ }
+ }
+}
}
- public void Initialize(object source, AUIApplicationInitEventArgs e)
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
{
CreateScrollView();
}
_animation = new Animation(1.0f); // 1 second of duration
- _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f));
- _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f));
+ _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.Linear), new TimePeriod(0.0f, 0.5f));
+ _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.Linear), new TimePeriod(0.5f, 0.5f));
// Connect the signal callback for animaiton finished signal
_animation.Finished += AnimationFinished;
_application.Initialized += Initialize;
}
- public void Initialize(object source, AUIApplicationInitEventArgs e)
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
{
Stage stage = Stage.GetCurrent();
stage.BackgroundColor = Color.White;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
delegate float UserAlphaFunctionDelegate(float progress);
- public void Initialize(object source, AUIApplicationInitEventArgs e)
+ public void Initialize(object source, NUIApplicationInitEventArgs e)
{
Log("Initialize() is called!");
Stage stage = Stage.GetCurrent();
_animation = new Animation(10000); // 10000 milli-second of duration
_animation.StartTime = 5000;
_animation.EndTime = 10000;
- _animation.TargetPoperty = "Position";
+ _animation.TargetProperty = "Position";
_animation.AlphaFunction = new AlphaFunction(_user_alpha_func);
_animation.Destination = new Vector3(150.0f, 150.0f, 0.0f);
_animation.AnimateTo(_view2);
// Connect the signal callback for animaiton finished signal
_animation.Finished += AnimationFinished;
- _animation.EndAction = Dali.Constants.Animation.EndAction.Discard;
+ _animation.EndAction = Animation.EndActions.Discard;
// Play the _animation
_animation.Play();
}
{
namespace Constants
{
- namespace AlphaFunction
- {
- public enum BuiltinFunction
- {
- Default = Dali.AlphaFunction.BuiltinFunction.DEFAULT,
- Linear = Dali.AlphaFunction.BuiltinFunction.LINEAR,
- Reverse = Dali.AlphaFunction.BuiltinFunction.REVERSE,
- EaseInSquare = Dali.AlphaFunction.BuiltinFunction.EASE_IN_SQUARE,
- EaseOutSquare = Dali.AlphaFunction.BuiltinFunction.EASE_OUT_SQUARE,
- EaseIn = Dali.AlphaFunction.BuiltinFunction.EASE_IN,
- EaseOut = Dali.AlphaFunction.BuiltinFunction.EASE_OUT,
- EaseInOut = Dali.AlphaFunction.BuiltinFunction.EASE_IN_OUT,
- EaseInSine = Dali.AlphaFunction.BuiltinFunction.EASE_IN_SINE,
- EaseOutSine = Dali.AlphaFunction.BuiltinFunction.EASE_OUT_SINE,
- EaseInOutSine = Dali.AlphaFunction.BuiltinFunction.EASE_IN_OUT_SINE,
- Bounce = Dali.AlphaFunction.BuiltinFunction.BOUNCE,
- Sin = Dali.AlphaFunction.BuiltinFunction.SIN,
- EaseOutBack = Dali.AlphaFunction.BuiltinFunction.EASE_OUT_BACK,
- Count = Dali.AlphaFunction.BuiltinFunction.COUNT
- }
- public enum Mode
- {
- BuiltinFunction = Dali.AlphaFunction.Mode.BUILTIN_FUNCTION,
- CustomFunction = Dali.AlphaFunction.Mode.CUSTOM_FUNCTION,
- Bezier = Dali.AlphaFunction.Mode.BEZIER
- }
- } // namespace AlphaFunction
-
- namespace FrameBuffer
- {
- namespace Attachment
- {
- public enum Mask
- {
- None = Dali.FrameBuffer.Attachment.Mask.NONE, ///< No attachments are created initially @SINCE_1_1.45
- Depth = Dali.FrameBuffer.Attachment.Mask.DEPTH, ///< Depth buffer bit-mask value @SINCE_1_1.45
- Stencil = Dali.FrameBuffer.Attachment.Mask.STENCIL , ///< Stencil buffer bit-mask value @SINCE_1_1.45
- DepthStencil = Dali.FrameBuffer.Attachment.Mask.DEPTH_STENCIL ///< The Framebuffer will be created with depth and stencil buffer @SINCE_1_1.45
- }
- } //namespace Attachment
- } // namespace FrameBuffer
public enum TextureType
{
OrthographicProjection = Dali.ProjectionMode.ORTHOGRAPHIC_PROJECTION ///< Relative distance from the camera does not affect the size of objects @SINCE_1_0.0
}
- namespace Animation
- {
- public enum EndAction
- {
- Cancel = Dali.Animation.DaliEndAction.Bake,
- Discard = Dali.Animation.DaliEndAction.Discard,
- Stop = Dali.Animation.DaliEndAction.BakeFinal
- }
- public enum Interpolation
- {
- Linear = Dali.Animation.Interpolation.Linear,
- Cubic = Dali.Animation.Interpolation.Cubic
- }
- public enum State
- {
- Stopped = Dali.Animation.State.STOPPED,
- Playing = Dali.Animation.State.PLAYING,
- Paused = Dali.Animation.State.PAUSED
- }
- } //namespace Animation
-
public struct ParentOrigin
{
public static readonly float Top = NDalic.ParentOriginTop;
public static readonly Dali.Vector3 Zero = Dali.Vector3.ZERO;
}
+ public struct Visual
+ {
+ public static readonly int PropertyType = NDalic.VISUAL_PROPERTY_TYPE;
+ public static readonly int PropertyShader = NDalic.VISUAL_PROPERTY_SHADER;
+
+ public static readonly int VertexShader = NDalic.VERTEX_SHADER;
+ public static readonly int FragmentShader = NDalic.FRAGMENT_SHADER;
+ public static readonly int SubdivideGridX = NDalic.SUBDIVIDE_GRID_X;
+ public static readonly int SubdivideGridY = NDalic.SUBDIVIDE_GRID_Y;
+ public static readonly int Hints = NDalic.HINTS;
+
+ public static readonly int Color = NDalic.COLOR;
+ public static readonly int Size = NDalic.SIZE;
+ public static readonly int AntiAliasing = NDalic.ANTI_ALIASING;
+
+ public static readonly int MixColor = NDalic.MIX_COLOR;
+
+ public static readonly int StartPosition = NDalic.START_POSITION;
+ public static readonly int EndPosition = NDalic.END_POSITION;
+ public static readonly int Center = NDalic.CENTER;
+ public static readonly int Radius = NDalic.RADIUS;
+ public static readonly int StopOffset = NDalic.STOP_OFFSET;
+ public static readonly int StopColor = NDalic.STOP_COLOR;
+ public static readonly int Units = NDalic.UNITS;
+ public static readonly int SpreadMethod = NDalic.SPREAD_METHOD;
+
+ public static readonly int ImageVisualURL = NDalic.IMAGE_VISUAL_URL;
+ public static readonly int ImageVisualFittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE;
+ public static readonly int ImageVisualSamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE;
+ public static readonly int ImageVisualDesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH;
+ public static readonly int ImageVisualDesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT;
+ public static readonly int ImageVisualSynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING;
+ public static readonly int ImageVisualBorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY;
+ public static readonly int ImageVisualBatchingEnabled = NDalic.IMAGE_VISUAL_BATCHING_ENABLED;
+ public static readonly int ImageVisualPixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA;
+ public static readonly int ImageVisualWrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U;
+ public static readonly int ImageVisualWrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V;
+
+ public enum Type
+ {
+ Border = Dali.VisualType.BORDER,
+ Color = Dali.VisualType.COLOR,
+ Gradient = Dali.VisualType.GRADIENT,
+ Image = Dali.VisualType.IMAGE,
+ Mesh = Dali.VisualType.MESH,
+ Primitive = Dali.VisualType.PRIMITIVE,
+ WireFrame = Dali.VisualType.WIREFRAME
+ }
+ }
+
} // namespace Constants
} // namesapce Dali
public delegate R DaliEventHandlerWithReturnType<T,U,R>(T source, U e);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- public delegate void EventCallbackDelegateType0();
+ internal delegate void EventCallbackDelegateType0();
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- public delegate void EventCallbackDelegateType1<T>(T arg1);
+ internal delegate void EventCallbackDelegateType1<T>(T arg1);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- public delegate void EventCallbackDelegateType2<T,U>(T arg1, U arg2);
+ internal delegate void EventCallbackDelegateType2<T,U>(T arg1, U arg2);
//this should be removed with EventHandler from .NET
public class FocusManager : BaseHandle {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.KeyboardFocusManager_SWIGUpcast(cPtr), cMemoryOwn) {
+ internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FocusManager_SWIGUpcast(cPtr), cMemoryOwn) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
- NDalicManualPINVOKE.delete_KeyboardFocusManager(swigCPtr);
+ NDalicManualPINVOKE.delete_FocusManager(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate IntPtr PreFocusChangeEventCallbackDelegate(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction);
- private PreFocusChangeEventHandler _keyboardFocusManagerPreFocusChangeEventHandler;
- private PreFocusChangeEventCallbackDelegate _keyboardFocusManagerPreFocusChangeEventCallbackDelegate;
+ private PreFocusChangeEventHandler _FocusManagerPreFocusChangeEventHandler;
+ private PreFocusChangeEventCallbackDelegate _FocusManagerPreFocusChangeEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusChangedEventCallbackDelegate(IntPtr actorCurrent, IntPtr actorNext);
- private FocusChangedEventHandler _keyboardFocusManagerFocusChangedEventHandler;
- private FocusChangedEventCallbackDelegate _keyboardFocusManagerFocusChangedEventCallbackDelegate;
+ private FocusChangedEventHandler _FocusManagerFocusChangedEventHandler;
+ private FocusChangedEventCallbackDelegate _FocusManagerFocusChangedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusGroupChangedEventCallbackDelegate(IntPtr currentFocusedActor, bool forwardDirection);
- private FocusGroupChangedEventHandler _keyboardFocusManagerFocusGroupChangedEventHandler;
- private FocusGroupChangedEventCallbackDelegate _keyboardFocusManagerFocusGroupChangedEventCallbackDelegate;
+ private FocusGroupChangedEventHandler _FocusManagerFocusGroupChangedEventHandler;
+ private FocusGroupChangedEventCallbackDelegate _FocusManagerFocusGroupChangedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusedActorEnterKeyEventCallbackDelegate(IntPtr actor);
- private FocusedActorEnterKeyEventHandler _keyboardFocusManagerFocusedActorEnterKeyEventHandler;
- private FocusedActorEnterKeyEventCallbackDelegate _keyboardFocusManagerFocusedActorEnterKeyEventCallbackDelegate;
+ private FocusedActorEnterKeyEventHandler _FocusManagerFocusedActorEnterKeyEventHandler;
+ private FocusedActorEnterKeyEventCallbackDelegate _FocusManagerFocusedActorEnterKeyEventCallbackDelegate;
public event PreFocusChangeEventHandler PreFocusChange
{
lock(this)
{
// Restricted to only one listener
- if (_keyboardFocusManagerPreFocusChangeEventHandler == null)
+ if (_FocusManagerPreFocusChangeEventHandler == null)
{
- _keyboardFocusManagerPreFocusChangeEventHandler += value;
+ _FocusManagerPreFocusChangeEventHandler += value;
- _keyboardFocusManagerPreFocusChangeEventCallbackDelegate = new PreFocusChangeEventCallbackDelegate(OnPreFocusChange);
- this.PreFocusChangeSignal().Connect(_keyboardFocusManagerPreFocusChangeEventCallbackDelegate);
+ _FocusManagerPreFocusChangeEventCallbackDelegate = new PreFocusChangeEventCallbackDelegate(OnPreFocusChange);
+ this.PreFocusChangeSignal().Connect(_FocusManagerPreFocusChangeEventCallbackDelegate);
}
}
}
{
lock(this)
{
- if (_keyboardFocusManagerPreFocusChangeEventHandler != null)
+ if (_FocusManagerPreFocusChangeEventHandler != null)
{
- this.PreFocusChangeSignal().Disconnect(_keyboardFocusManagerPreFocusChangeEventCallbackDelegate);
+ this.PreFocusChangeSignal().Disconnect(_FocusManagerPreFocusChangeEventCallbackDelegate);
}
- _keyboardFocusManagerPreFocusChangeEventHandler -= value;
+ _FocusManagerPreFocusChangeEventHandler -= value;
}
}
}
- // Callback for KeyboardFocusManager PreFocusChangeSignal
+ // Callback for FocusManager PreFocusChangeSignal
private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction)
{
Actor actor = null;
e.Proposed = Actor.GetActorFromPtr(proposed);
e.Direction = direction;
- if (_keyboardFocusManagerPreFocusChangeEventHandler != null)
+ if (_FocusManagerPreFocusChangeEventHandler != null)
{
//here we send all data to user event handlers
- actor = _keyboardFocusManagerPreFocusChangeEventHandler(this, e);
+ actor = _FocusManagerPreFocusChangeEventHandler(this, e);
}
return actor.GetPtrfromActor();
lock(this)
{
// Restricted to only one listener
- if (_keyboardFocusManagerFocusChangedEventHandler == null)
+ if (_FocusManagerFocusChangedEventHandler == null)
{
- _keyboardFocusManagerFocusChangedEventHandler += value;
+ _FocusManagerFocusChangedEventHandler += value;
- _keyboardFocusManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged);
- this.FocusChangedSignal().Connect(_keyboardFocusManagerFocusChangedEventCallbackDelegate);
+ _FocusManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged);
+ this.FocusChangedSignal().Connect(_FocusManagerFocusChangedEventCallbackDelegate);
}
}
}
{
lock(this)
{
- if (_keyboardFocusManagerFocusChangedEventHandler != null)
+ if (_FocusManagerFocusChangedEventHandler != null)
{
- this.FocusChangedSignal().Disconnect(_keyboardFocusManagerFocusChangedEventCallbackDelegate);
+ this.FocusChangedSignal().Disconnect(_FocusManagerFocusChangedEventCallbackDelegate);
}
- _keyboardFocusManagerFocusChangedEventHandler -= value;
+ _FocusManagerFocusChangedEventHandler -= value;
}
}
}
- // Callback for KeyboardFocusManager FocusChangedSignal
+ // Callback for FocusManager FocusChangedSignal
private void OnFocusChanged(IntPtr actorCurrent, IntPtr actorNext)
{
FocusChangedEventArgs e = new FocusChangedEventArgs();
e.ActorCurrent = Actor.GetActorFromPtr(actorCurrent);
e.ActorNext = Actor.GetActorFromPtr(actorNext);
- if (_keyboardFocusManagerFocusChangedEventHandler != null)
+ if (_FocusManagerFocusChangedEventHandler != null)
{
//here we send all data to user event handlers
- _keyboardFocusManagerFocusChangedEventHandler(this, e);
+ _FocusManagerFocusChangedEventHandler(this, e);
}
}
lock(this)
{
// Restricted to only one listener
- if (_keyboardFocusManagerFocusGroupChangedEventHandler == null)
+ if (_FocusManagerFocusGroupChangedEventHandler == null)
{
- _keyboardFocusManagerFocusGroupChangedEventHandler += value;
+ _FocusManagerFocusGroupChangedEventHandler += value;
- _keyboardFocusManagerFocusGroupChangedEventCallbackDelegate = new FocusGroupChangedEventCallbackDelegate(OnFocusGroupChanged);
- this.FocusGroupChangedSignal().Connect(_keyboardFocusManagerFocusGroupChangedEventCallbackDelegate);
+ _FocusManagerFocusGroupChangedEventCallbackDelegate = new FocusGroupChangedEventCallbackDelegate(OnFocusGroupChanged);
+ this.FocusGroupChangedSignal().Connect(_FocusManagerFocusGroupChangedEventCallbackDelegate);
}
}
}
{
lock(this)
{
- if (_keyboardFocusManagerFocusGroupChangedEventHandler != null)
+ if (_FocusManagerFocusGroupChangedEventHandler != null)
{
- this.FocusGroupChangedSignal().Disconnect(_keyboardFocusManagerFocusGroupChangedEventCallbackDelegate);
+ this.FocusGroupChangedSignal().Disconnect(_FocusManagerFocusGroupChangedEventCallbackDelegate);
}
- _keyboardFocusManagerFocusGroupChangedEventHandler -= value;
+ _FocusManagerFocusGroupChangedEventHandler -= value;
}
}
}
- // Callback for KeyboardFocusManager FocusGroupChangedSignal
+ // Callback for FocusManager FocusGroupChangedSignal
private void OnFocusGroupChanged(IntPtr currentFocusedActor, bool forwardDirection)
{
FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
e.CurrentFocusedActor = Actor.GetActorFromPtr(currentFocusedActor);
e.ForwardDirection = forwardDirection;
- if (_keyboardFocusManagerFocusGroupChangedEventHandler != null)
+ if (_FocusManagerFocusGroupChangedEventHandler != null)
{
//here we send all data to user event handlers
- _keyboardFocusManagerFocusGroupChangedEventHandler(this, e);
+ _FocusManagerFocusGroupChangedEventHandler(this, e);
}
}
lock(this)
{
// Restricted to only one listener
- if (_keyboardFocusManagerFocusedActorEnterKeyEventHandler == null)
+ if (_FocusManagerFocusedActorEnterKeyEventHandler == null)
{
- _keyboardFocusManagerFocusedActorEnterKeyEventHandler += value;
+ _FocusManagerFocusedActorEnterKeyEventHandler += value;
- _keyboardFocusManagerFocusedActorEnterKeyEventCallbackDelegate = new FocusedActorEnterKeyEventCallbackDelegate(OnFocusedActorEnterKey);
- this.FocusedActorEnterKeySignal().Connect(_keyboardFocusManagerFocusedActorEnterKeyEventCallbackDelegate);
+ _FocusManagerFocusedActorEnterKeyEventCallbackDelegate = new FocusedActorEnterKeyEventCallbackDelegate(OnFocusedActorEnterKey);
+ this.FocusedActorEnterKeySignal().Connect(_FocusManagerFocusedActorEnterKeyEventCallbackDelegate);
}
}
}
{
lock(this)
{
- if (_keyboardFocusManagerFocusedActorEnterKeyEventHandler != null)
+ if (_FocusManagerFocusedActorEnterKeyEventHandler != null)
{
- this.FocusedActorEnterKeySignal().Disconnect(_keyboardFocusManagerFocusedActorEnterKeyEventCallbackDelegate);
+ this.FocusedActorEnterKeySignal().Disconnect(_FocusManagerFocusedActorEnterKeyEventCallbackDelegate);
}
- _keyboardFocusManagerFocusedActorEnterKeyEventHandler -= value;
+ _FocusManagerFocusedActorEnterKeyEventHandler -= value;
}
}
}
- // Callback for KeyboardFocusManager FocusedActorEnterKeySignal
+ // Callback for FocusManager FocusedActorEnterKeySignal
private void OnFocusedActorEnterKey(IntPtr actor)
{
FocusedActorEnterKeyEventArgs e = new FocusedActorEnterKeyEventArgs();
// Populate all members of "e" (FocusedActorEnterKeyEventArgs) with real data
e.Actor = Actor.GetActorFromPtr(actor);
- if (_keyboardFocusManagerFocusedActorEnterKeyEventHandler != null)
+ if (_FocusManagerFocusedActorEnterKeyEventHandler != null)
{
//here we send all data to user event handlers
- _keyboardFocusManagerFocusedActorEnterKeyEventHandler(this, e);
+ _FocusManagerFocusedActorEnterKeyEventHandler(this, e);
}
}
- public FocusManager() : this(NDalicManualPINVOKE.new_KeyboardFocusManager(), true) {
+ public FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public static FocusManager Get() {
- FocusManager ret = new FocusManager(NDalicManualPINVOKE.KeyboardFocusManager_Get(), true);
+ FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public bool SetCurrentFocusActor(Actor actor) {
- bool ret = NDalicManualPINVOKE.KeyboardFocusManager_SetCurrentFocusActor(swigCPtr, Actor.getCPtr(actor));
+ bool ret = NDalicManualPINVOKE.FocusManager_SetCurrentFocusActor(swigCPtr, Actor.getCPtr(actor));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public Actor GetCurrentFocusActor() {
- Actor ret = new Actor(NDalicManualPINVOKE.KeyboardFocusManager_GetCurrentFocusActor(swigCPtr), true);
+ Actor ret = new Actor(NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public bool MoveFocus(View.KeyboardFocus.Direction direction) {
- bool ret = NDalicManualPINVOKE.KeyboardFocusManager_MoveFocus(swigCPtr, (int)direction);
+ bool ret = NDalicManualPINVOKE.FocusManager_MoveFocus(swigCPtr, (int)direction);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void ClearFocus() {
- NDalicManualPINVOKE.KeyboardFocusManager_ClearFocus(swigCPtr);
+ NDalicManualPINVOKE.FocusManager_ClearFocus(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public void SetFocusGroupLoop(bool enabled) {
- NDalicManualPINVOKE.KeyboardFocusManager_SetFocusGroupLoop(swigCPtr, enabled);
+ NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public bool GetFocusGroupLoop() {
- bool ret = NDalicManualPINVOKE.KeyboardFocusManager_GetFocusGroupLoop(swigCPtr);
+ bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void SetAsFocusGroup(Actor actor, bool isFocusGroup) {
- NDalicManualPINVOKE.KeyboardFocusManager_SetAsFocusGroup(swigCPtr, Actor.getCPtr(actor), isFocusGroup);
+ NDalicManualPINVOKE.FocusManager_SetAsFocusGroup(swigCPtr, Actor.getCPtr(actor), isFocusGroup);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public bool IsFocusGroup(Actor actor) {
- bool ret = NDalicManualPINVOKE.KeyboardFocusManager_IsFocusGroup(swigCPtr, Actor.getCPtr(actor));
+ bool ret = NDalicManualPINVOKE.FocusManager_IsFocusGroup(swigCPtr, Actor.getCPtr(actor));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public Actor GetFocusGroup(Actor actor) {
- Actor ret = new Actor(NDalicManualPINVOKE.KeyboardFocusManager_GetFocusGroup(swigCPtr, Actor.getCPtr(actor)), true);
+ Actor ret = new Actor(NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, Actor.getCPtr(actor)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void SetFocusIndicatorActor(Actor indicator) {
- NDalicManualPINVOKE.KeyboardFocusManager_SetFocusIndicatorActor(swigCPtr, Actor.getCPtr(indicator));
+ NDalicManualPINVOKE.FocusManager_SetFocusIndicatorActor(swigCPtr, Actor.getCPtr(indicator));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public Actor GetFocusIndicatorActor() {
- Actor ret = new Actor(NDalicManualPINVOKE.KeyboardFocusManager_GetFocusIndicatorActor(swigCPtr), true);
+ Actor ret = new Actor(NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public KeyboardPreFocusChangeSignal PreFocusChangeSignal() {
- KeyboardPreFocusChangeSignal ret = new KeyboardPreFocusChangeSignal(NDalicManualPINVOKE.KeyboardFocusManager_PreFocusChangeSignal(swigCPtr), false);
+ public PreFocusChangeSignal PreFocusChangeSignal() {
+ PreFocusChangeSignal ret = new PreFocusChangeSignal(NDalicManualPINVOKE.FocusManager_PreFocusChangeSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public FocusChangedSignal FocusChangedSignal() {
- FocusChangedSignal ret = new FocusChangedSignal(NDalicManualPINVOKE.KeyboardFocusManager_FocusChangedSignal(swigCPtr), false);
+ FocusChangedSignal ret = new FocusChangedSignal(NDalicManualPINVOKE.FocusManager_FocusChangedSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public FocusGroupChangedSignal FocusGroupChangedSignal() {
- FocusGroupChangedSignal ret = new FocusGroupChangedSignal(NDalicManualPINVOKE.KeyboardFocusManager_FocusGroupChangedSignal(swigCPtr), false);
+ FocusGroupChangedSignal ret = new FocusGroupChangedSignal(NDalicManualPINVOKE.FocusManager_FocusGroupChangedSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public ActorSignal FocusedActorEnterKeySignal() {
- ActorSignal ret = new ActorSignal(NDalicManualPINVOKE.KeyboardFocusManager_FocusedActorEnterKeySignal(swigCPtr), false);
+ ActorSignal ret = new ActorSignal(NDalicManualPINVOKE.FocusManager_FocusedActorEnterKeySignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
namespace Dali {
-public delegate IntPtr SwigDelegateKeyboardPreFocusChangeSignal(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction);
+public delegate IntPtr SwigDelegatePreFocusChangeSignal(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction);
-public class KeyboardPreFocusChangeSignal : global::System.IDisposable {
+public class PreFocusChangeSignal : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
- internal KeyboardPreFocusChangeSignal(global::System.IntPtr cPtr, bool cMemoryOwn) {
+ internal PreFocusChangeSignal(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardPreFocusChangeSignal obj) {
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PreFocusChangeSignal obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
- ~KeyboardPreFocusChangeSignal() {
+ ~PreFocusChangeSignal() {
DisposeQueue.Instance.Add(this);
}
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
- NDalicManualPINVOKE.delete_KeyboardPreFocusChangeSignal(swigCPtr);
+ NDalicManualPINVOKE.delete_PreFocusChangeSignal(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
}
public bool Empty() {
- bool ret = NDalicManualPINVOKE.KeyboardPreFocusChangeSignal_Empty(swigCPtr);
+ bool ret = NDalicManualPINVOKE.PreFocusChangeSignal_Empty(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public uint GetConnectionCount() {
- uint ret = NDalicManualPINVOKE.KeyboardPreFocusChangeSignal_GetConnectionCount(swigCPtr);
+ uint ret = NDalicManualPINVOKE.PreFocusChangeSignal_GetConnectionCount(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public void Connect(FocusManager.PreFocusChangeEventCallbackDelegate func) {
- NDalicManualPINVOKE.KeyboardPreFocusChangeSignal_Connect(swigCPtr, func);
+ NDalicManualPINVOKE.PreFocusChangeSignal_Connect(swigCPtr, func);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public void Disconnect(System.Delegate func) {
System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
{
- NDalicManualPINVOKE.KeyboardPreFocusChangeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ NDalicManualPINVOKE.PreFocusChangeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
public Actor Emit(Actor arg1, Actor arg2, View.KeyboardFocus.Direction arg3) {
- Actor ret = new Actor(NDalicManualPINVOKE.KeyboardPreFocusChangeSignal_Emit(swigCPtr, Actor.getCPtr(arg1), Actor.getCPtr(arg2), (int)arg3), true);
+ Actor ret = new Actor(NDalicManualPINVOKE.PreFocusChangeSignal_Emit(swigCPtr, Actor.getCPtr(arg1), Actor.getCPtr(arg2), (int)arg3), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- public KeyboardPreFocusChangeSignal() : this(NDalicManualPINVOKE.new_KeyboardPreFocusChangeSignal(), true) {
+ public PreFocusChangeSignal() : this(NDalicManualPINVOKE.new_PreFocusChangeSignal(), true) {
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
class NDalicManualPINVOKE
{
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_new_KeyboardFocusManager")]
- public static extern global::System.IntPtr new_KeyboardFocusManager();
+ public static extern global::System.IntPtr new_FocusManager();
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_delete_KeyboardFocusManager")]
- public static extern void delete_KeyboardFocusManager(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern void delete_FocusManager(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_Get")]
- public static extern global::System.IntPtr KeyboardFocusManager_Get();
+ public static extern global::System.IntPtr FocusManager_Get();
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_SetCurrentFocusActor")]
- public static extern bool KeyboardFocusManager_SetCurrentFocusActor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern bool FocusManager_SetCurrentFocusActor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_GetCurrentFocusActor")]
- public static extern global::System.IntPtr KeyboardFocusManager_GetCurrentFocusActor(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FocusManager_GetCurrentFocusActor(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_MoveFocus")]
- public static extern bool KeyboardFocusManager_MoveFocus(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+ public static extern bool FocusManager_MoveFocus(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_ClearFocus")]
- public static extern void KeyboardFocusManager_ClearFocus(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern void FocusManager_ClearFocus(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_SetFocusGroupLoop")]
- public static extern void KeyboardFocusManager_SetFocusGroupLoop(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+ public static extern void FocusManager_SetFocusGroupLoop(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_GetFocusGroupLoop")]
- public static extern bool KeyboardFocusManager_GetFocusGroupLoop(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern bool FocusManager_GetFocusGroupLoop(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_SetAsFocusGroup")]
- public static extern void KeyboardFocusManager_SetAsFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3);
+ public static extern void FocusManager_SetAsFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_IsFocusGroup")]
- public static extern bool KeyboardFocusManager_IsFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern bool FocusManager_IsFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_GetFocusGroup")]
- public static extern global::System.IntPtr KeyboardFocusManager_GetFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern global::System.IntPtr FocusManager_GetFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_SetFocusIndicatorActor")]
- public static extern void KeyboardFocusManager_SetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern void FocusManager_SetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_GetFocusIndicatorActor")]
- public static extern global::System.IntPtr KeyboardFocusManager_GetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FocusManager_GetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_PreFocusChangeSignal")]
- public static extern global::System.IntPtr KeyboardFocusManager_PreFocusChangeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FocusManager_PreFocusChangeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_FocusChangedSignal")]
- public static extern global::System.IntPtr KeyboardFocusManager_FocusChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FocusManager_FocusChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_FocusGroupChangedSignal")]
- public static extern global::System.IntPtr KeyboardFocusManager_FocusGroupChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FocusManager_FocusGroupChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_FocusedActorEnterKeySignal")]
- public static extern global::System.IntPtr KeyboardFocusManager_FocusedActorEnterKeySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FocusManager_FocusedActorEnterKeySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardPreFocusChangeSignal_Empty")]
- public static extern bool KeyboardPreFocusChangeSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern bool PreFocusChangeSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardPreFocusChangeSignal_GetConnectionCount")]
- public static extern uint KeyboardPreFocusChangeSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern uint PreFocusChangeSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardPreFocusChangeSignal_Connect")]
- public static extern void KeyboardPreFocusChangeSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, FocusManager.PreFocusChangeEventCallbackDelegate delegate1);
+ public static extern void PreFocusChangeSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, FocusManager.PreFocusChangeEventCallbackDelegate delegate1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardPreFocusChangeSignal_Disconnect")]
- public static extern void KeyboardPreFocusChangeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern void PreFocusChangeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardPreFocusChangeSignal_Emit")]
- public static extern global::System.IntPtr KeyboardPreFocusChangeSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, int jarg4);
+ public static extern global::System.IntPtr PreFocusChangeSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, int jarg4);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_new_KeyboardPreFocusChangeSignal")]
- public static extern global::System.IntPtr new_KeyboardPreFocusChangeSignal();
+ public static extern global::System.IntPtr new_PreFocusChangeSignal();
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_delete_KeyboardPreFocusChangeSignal")]
- public static extern void delete_KeyboardPreFocusChangeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern void delete_PreFocusChangeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_KeyboardFocusManager_SWIGUpcast")]
- public static extern global::System.IntPtr KeyboardFocusManager_SWIGUpcast(global::System.IntPtr jarg1);
+ public static extern global::System.IntPtr FocusManager_SWIGUpcast(global::System.IntPtr jarg1);
[global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_ViewWrapperImpl_CONTROL_BEHAVIOUR_FLAG_COUNT_get")]
public static extern int ViewWrapperImpl_CONTROL_BEHAVIOUR_FLAG_COUNT_get();
*/
public Position(Vector3 o)
{
- x = o.x;
- y = o.y;
- z = o.z;
+ x = o.X;
+ y = o.Y;
+ z = o.Z;
}
///< name "X", type float (Position X value)
public static implicit operator Position(Vector3 vec)
{
- return new Position(vec.x, vec.y, vec.z);
+ return new Position(vec.X, vec.Y, vec.Z);
}
}
}
*/
public Size(Vector2 o)
{
- width = o.x;
- height = o.y;
+ width = o.X;
+ height = o.Y;
}
/**
set { height = value; }
}
+ public float Width
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float Height
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
/**
* @brief operator+
*
return copy;
}
- // User-defined conversion from Position to Vector3
+ // User-defined conversion from Position to Vector2
public static implicit operator Vector2(Size size)
{
return new Vector2(size.width, size.height);
public static implicit operator Size(Vector2 vec)
{
- return new Size(vec.x, vec.y);
+ return new Size(vec.X, vec.Y);
}
}
+
+ public class Size3D
+ {
+ private float width;
+ private float height;
+ private float depth;
+
+ public Size3D(float a, float b, float c)
+ {
+ width = a;
+ height = b;
+ depth = c;
+ }
+
+ public Size3D()
+ {
+ width = 0.0f;
+ height = 0.0f;
+ depth = 0.0f;
+ }
+
+ public Size3D(Vector3 o)
+ {
+ width = o.X;
+ height = o.Y;
+ depth = o.Z;
+ }
+
+ public Size3D(Vector2 o)
+ {
+ width = o.X;
+ height = o.Y;
+ depth = 0.0f;
+ }
+
+ public Size3D(Size3D a)
+ {
+ width = a.width;
+ height = a.height;
+ depth = a.depth;
+ }
+
+ public float W
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float H
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
+ public float D
+ {
+ get { return depth; }
+ set { depth = value; }
+ }
+
+ public float Width
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float Height
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
+ public float Depth
+ {
+ get { return depth; }
+ set { depth = value; }
+ }
+
+ public float X
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float Y
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
+ public float Z
+ {
+ get { return depth; }
+ set { depth = value; }
+ }
+
+ // User-defined conversion from Position to Vector3
+ public static implicit operator Vector3(Size3D size)
+ {
+ return new Vector3(size.width, size.height, size.depth);
+ }
+
+ public static implicit operator Size3D(Vector3 vec)
+ {
+ return new Size3D(vec.X, vec.Y, vec.Z);
+ }
+
+ }
+
}
next
end
+ #exception case <<<
+ #Tooltip gives swig build error
+ if( property.name == "Tooltip" )
+ next
+ end
+ #exception case >>>
+
$totalProperties+=1 # keep track of total
propertyType = propertyInfo[1] # e.g. bool or int
hasChildProperties = true
end
- property.csharpGetter =" public #{propertyType} #{property.name} \n"\
- " { \n"\
- " get \n" \
+ property.csharpGetter =" public #{propertyType} #{property.name}\n"\
+ " {\n"\
+ " get\n" \
" {\n"\
" #{tempDeclaration}\n"\
" GetProperty( #{propertyName}).Get( #{propertyArg} temp );\n"\
if property.writable
#text.SetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT, new Property.Value("CENTER"));
- property.csharpSetter = " set \n" \
- " { \n"\
+ property.csharpSetter = " set\n" \
+ " {\n"\
" SetProperty( #{propertyName}, new Dali.Property.Value( value ) );\n" \
" }\n"\
" }\n"
else
property.csharpSetter = "}" # close the opening property declaration
end
+
+ #exception case <<<
+ if( property.name == "Behavior" )
+ property.csharpGetter =" public Layer.LayerBehavior #{property.name} \n"\
+ " { \n"\
+ " get \n" \
+ " {\n"\
+ " return GetBehavior();\n"\
+ " }\n"
+
+ property.csharpSetter = " set \n" \
+ " { \n"\
+ " SetBehavior( value );\n" \
+ " }\n"\
+ " }\n"
+ end
+ #exception case >>>
end
# write normal properties to the class's own csharp file
writePropertiesToCSharpFile( daliClass )