X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=58e293a913663dccd7403b6492850073885253a2;hp=4213548eb3724eb02d1f4401ba3272d134f6eef4;hb=d725a0d2d6b11eff469c9a4d2c13df9e00e6b85f;hpb=a881757839b7abb008873a68c67e17b3ba39669b diff --git a/base/dali-toolkit/public-api/controls/control.cpp b/base/dali-toolkit/public-api/controls/control.cpp index 4213548..58e293a 100644 --- a/base/dali-toolkit/public-api/controls/control.cpp +++ b/base/dali-toolkit/public-api/controls/control.cpp @@ -1,19 +1,18 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ +// +// Copyright (c) 2014 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.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://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include #include @@ -29,17 +28,7 @@ const char* const Control::SIGNAL_KEY_EVENT = "key-event"; Control Control::New() { - // Use TypeRegistry to create instance of control so that the type-info matches Control rather than ControlImpl - TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(Control) ); - DALI_ASSERT_ALWAYS( typeInfo && "TypeRegistry returning Invalid TypeInfo" ); - - BaseHandle handle = typeInfo.CreateInstance(); - DALI_ASSERT_ALWAYS( handle && "Unable to Create Control" ); - - Control control = DownCast( handle ); - DALI_ASSERT_ALWAYS( handle && "TypeRegistry did not create a Control" ); - - return control; + return Internal::Control::New(); } Control::Control() @@ -47,7 +36,7 @@ Control::Control() } Control::Control(const Control& uiControl) -: CustomActor( uiControl ? static_cast( uiControl.GetImplementation() ).GetOwner() : NULL) +: CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL) { } @@ -66,17 +55,17 @@ Control& Control::operator=( const Control& handle ) Control Control::DownCast( BaseHandle handle ) { - return DownCast(handle); + return DownCast< Control, Internal::Control >(handle); } -ControlImpl& Control::GetImplementation() +Internal::Control& Control::GetImplementation() { - return static_cast(CustomActor::GetImplementation()); + return static_cast(CustomActor::GetImplementation()); } -const ControlImpl& Control::GetImplementation() const +const Internal::Control& Control::GetImplementation() const { - return static_cast(CustomActor::GetImplementation()); + return static_cast(CustomActor::GetImplementation()); } void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ) @@ -214,7 +203,7 @@ std::size_t Control::GetConnectionCount() const } -Control::Control(ControlImpl& implementation) +Control::Control(Internal::Control& implementation) : CustomActor(implementation) { } @@ -222,7 +211,7 @@ Control::Control(ControlImpl& implementation) Control::Control(Dali::Internal::CustomActor* internal) : CustomActor(internal) { - VerifyCustomActorPointer(internal); + VerifyCustomActorPointer(internal); } } // namespace Toolkit