2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "relayout-controller.h"
21 #include "relayout-controller-impl.h"
25 #include <boost/thread/tss.hpp>
28 #include <dali/integration-api/debug.h>
32 #include "dali-toolkit/public-api/controls/control.h"
33 #include "dali-toolkit/public-api/controls/control-impl.h"
34 #include "dali-toolkit/public-api/controls/text-view/text-view.h"
45 RelayoutController::RelayoutController()
50 RelayoutController::~RelayoutController()
55 RelayoutController RelayoutController::Get()
57 RelayoutController controller;
59 // Check whether the RelayoutController is already created
60 Dali::Adaptor& adaptor = Dali::Adaptor::Get();
61 Dali::BaseHandle handle = adaptor.GetSingleton(typeid(RelayoutController));
65 // If so, downcast the handle of singleton to RelayoutController
66 controller = RelayoutController(dynamic_cast<Internal::RelayoutControllerImpl*>(handle.GetObjectPtr()));
71 // If not, create the RelayoutController and register it as a singleton
72 controller = RelayoutController(new Internal::RelayoutControllerImpl());
73 adaptor.RegisterSingleton(typeid(controller), controller);
79 RelayoutController::RelayoutController(Internal::RelayoutControllerImpl *impl)
84 void RelayoutController::Request()
86 GetImpl(*this).Request();
90 } // namespace Internal
92 } // namespace Toolkit