2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
17 #include <commons/Exception.h>
21 const std::size_t NUMBER_OF_AVAILABLE_SCREENS = 1;
22 const std::size_t INDEX_OF_DEFAULT_SCREEN = 1;
25 namespace WrtPlugins {
28 Manager& Manager::getInstance()
30 static Manager instance;
34 Api::Display::IScreen* Manager::getScreen(std::size_t index) const
37 index = INDEX_OF_DEFAULT_SCREEN;
40 if (index > NUMBER_OF_AVAILABLE_SCREENS) {
41 ThrowMsg(Commons::OutOfRangeException, "Screen is not available.");
44 Screens::iterator it = m_screens.find(index);
45 if (it == m_screens.end()) {
46 Api::Display::IScreen* screen = new Screen(index);
47 m_screens.insert(Screens::value_type(index, screen));
53 std::size_t Manager::getScreensCount() const
55 return NUMBER_OF_AVAILABLE_SCREENS;
60 Screens::iterator it = m_screens.begin();
61 for (; it != m_screens.end(); ++it) {