X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Fcontrol-wrapper-impl.cpp;h=37def2b4f5c24b6969940077cf33cc43119297a7;hb=b5967a328022a3d60e341feea6dfd27e42530690;hp=48019feb90754799b3f81750b83f406c812765bb;hpb=be7711b99f7e5db0b712194636745045d4da1154;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp b/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp index 48019fe..37def2b 100755 --- a/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp +++ b/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -18,9 +18,16 @@ // CLASS HEADER #include -// INTERNAL INCLUDES +// EXTERNAL INCLUDES #include +#include +#include +#include +#include + +// INTERNAL INCLUDES #include +#include #include #include #include @@ -34,11 +41,26 @@ namespace Toolkit namespace Internal { +namespace +{ + +BaseHandle Create() +{ + // empty handle as we cannot create control wrapper + return BaseHandle(); +} + +// Setup type-registry. +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ControlWrapper, Toolkit::Control, Create ) +DALI_TYPE_REGISTRATION_END() + +} + /* * Implementation. */ -Dali::Toolkit::ControlWrapper ControlWrapper::New( ControlWrapper* controlWrapper ) +Dali::Toolkit::ControlWrapper ControlWrapper::New( const std::string& typeName, ControlWrapper* controlWrapper ) { ControlWrapperPtr wrapper( controlWrapper ); @@ -49,6 +71,19 @@ Dali::Toolkit::ControlWrapper ControlWrapper::New( ControlWrapper* controlWrappe // This can only be done after the CustomActor connection has been made. wrapper->Initialize(); + // Different types of C# custom view registered themselves using type registry, + // but their type names are registered per type not per instance, so they still + // have the same wrong type name in native side when type registry queries the + // unique type name of each instance using typeid() because of the binding. + // Therefore, we have to link each instance with its correct type info if already + // pre-registered. + + TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeName ); + if(typeInfo) + { + Dali::DevelHandle::SetTypeInfo( handle, typeInfo ); + } + return handle; } @@ -88,37 +123,47 @@ bool ControlWrapper::RelayoutDependentOnChildrenBase( Dimension::Type dimension void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual ) { - Control::RegisterVisual( index, visual ); + DevelControl::RegisterVisual( *this, index, visual ); +} + +void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex ) +{ + DevelControl::RegisterVisual( *this, index, visual, depthIndex ); } void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled ) { - Control::RegisterVisual( index, visual, enabled ); + DevelControl::RegisterVisual( *this, index, visual, enabled ); +} + +void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex ) +{ + DevelControl::RegisterVisual( *this, index, visual, enabled, depthIndex ); } void ControlWrapper::UnregisterVisual( Property::Index index ) { - Control::UnregisterVisual( index ); + DevelControl::UnregisterVisual( *this, index ); } Toolkit::Visual::Base ControlWrapper::GetVisual( Property::Index index ) const { - return Control::GetVisual( index ); + return DevelControl::GetVisual( *this, index ); } void ControlWrapper::EnableVisual( Property::Index index, bool enable ) { - Control::EnableVisual( index, enable ); + DevelControl::EnableVisual( *this, index, enable ); } bool ControlWrapper::IsVisualEnabled( Property::Index index ) const { - return Control::IsVisualEnabled( index ); + return DevelControl::IsVisualEnabled( *this, index ); } Dali::Animation ControlWrapper::CreateTransition( const Toolkit::TransitionData& handle ) { - return Control::CreateTransition( handle ); + return DevelControl::CreateTransition( *this, handle ); } void ControlWrapper::ApplyThemeStyle() @@ -135,6 +180,11 @@ void ControlWrapper::ApplyThemeStyle() } } +Dali::TypeInfo ControlWrapper::GetTypeInfo() +{ + return DevelCustomActor::GetTypeInfo(Self()); +} + } // namespace Internal } // namespace Toolkit