X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=base%2Fdali-toolkit%2Fpublic-api%2Ffocus-manager%2Ffocus-manager.cpp;h=a4cddb1077cb8dd8eda71d0a8790dbbfa80adf8a;hb=c11191b4322a0687606b3e7f05db0a31f85403cc;hp=d172135c660f83b1919559f838720bc22204eb22;hpb=30f6ca1e541089b19f2b349a8a12d8a5bcaf2f9e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/base/dali-toolkit/public-api/focus-manager/focus-manager.cpp b/base/dali-toolkit/public-api/focus-manager/focus-manager.cpp index d172135..a4cddb1 100644 --- a/base/dali-toolkit/public-api/focus-manager/focus-manager.cpp +++ b/base/dali-toolkit/public-api/focus-manager/focus-manager.cpp @@ -1,18 +1,19 @@ -// -// 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. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER @@ -47,19 +48,22 @@ FocusManager FocusManager::Get() FocusManager manager; // Check whether the focus manager is already created - Dali::Adaptor& adaptor = Dali::Adaptor::Get(); - Dali::BaseHandle handle = adaptor.GetSingleton(typeid(FocusManager)); - if(handle) + SingletonService singletonService( SingletonService::Get() ); + if ( singletonService ) { - // If so, downcast the handle of singleton to focus manager - manager = FocusManager(dynamic_cast(handle.GetObjectPtr())); - } - - if(!manager) - { - // If not, create the focus manager and register it as a singleton - manager = FocusManager(new Internal::FocusManager()); - adaptor.RegisterSingleton(typeid(manager), manager); + Dali::BaseHandle handle = singletonService.GetSingleton(typeid(FocusManager)); + if(handle) + { + // If so, downcast the handle of singleton to focus manager + manager = FocusManager(dynamic_cast(handle.GetObjectPtr())); + } + + if(!manager) + { + // If not, create the focus manager and register it as a singleton + manager = FocusManager(new Internal::FocusManager()); + singletonService.Register(typeid(manager), manager); + } } return manager;