From 6e294823f8b8909bf467cf0e20734e37af7a557f Mon Sep 17 00:00:00 2001 From: Nobuhiko Tanibata Date: Wed, 9 Jan 2013 10:56:56 +0900 Subject: [PATCH] LayerManagerService: Add LmScreen class -LmScreen is a control class for controlling LayerRenderOrder Signed-off-by: Nobuhiko Tanibata --- LayerManagerService/include/LmScreen.h | 91 ++++++++++++++++++++++++++++++ LayerManagerService/include/LmScreenList.h | 32 +++++++++++ 2 files changed, 123 insertions(+) create mode 100644 LayerManagerService/include/LmScreen.h create mode 100644 LayerManagerService/include/LmScreenList.h diff --git a/LayerManagerService/include/LmScreen.h b/LayerManagerService/include/LmScreen.h new file mode 100644 index 0000000..aa68ba9 --- /dev/null +++ b/LayerManagerService/include/LmScreen.h @@ -0,0 +1,91 @@ +/*************************************************************************** + * + * Copyright 2010,2011 BMW Car IT GmbH + * Copyright (C) 2012 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh + * + * + * 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. + * + ****************************************************************************/ + +#ifndef _LMSCREEN_H_ +#define _LMSCREEN_H_ + +#include "Layer.h" +#include "LayerList.h" +#include +#include + +/* + * A Screen for LayerManagement + */ +class LmScreen +{ + friend class Scene; + +public: + LmScreen(); + LmScreen(unsigned int id, const char* deviceName); + + virtual ~LmScreen(); + + virtual unsigned int getID(); + virtual LayerList& getCurrentRenderOrder(); + char* getDeviceName(); + +protected: + unsigned int m_id; + +private: + LayerList m_currentRenderOrder; + char* m_deviceName; +}; + +inline LmScreen::LmScreen() +: m_id(0) +{ + m_deviceName = NULL; +} + +inline LmScreen::LmScreen(unsigned int id, const char* deviceName) +: m_id(id) +{ + m_deviceName = new char[strlen(deviceName)]; + strcpy(m_deviceName, deviceName); +} + +inline LmScreen::~LmScreen() +{ + if (NULL != m_deviceName) + { + delete m_deviceName; + m_deviceName = NULL; + } +} + +inline LayerList& LmScreen::getCurrentRenderOrder() // TODO: const +{ + return m_currentRenderOrder; +} + +inline unsigned int LmScreen::getID() +{ + return m_id; +} + +inline char* LmScreen::getDeviceName() +{ + return m_deviceName; +} + +#endif /* _LMSCREEN_H_ */ diff --git a/LayerManagerService/include/LmScreenList.h b/LayerManagerService/include/LmScreenList.h new file mode 100644 index 0000000..e8c7031 --- /dev/null +++ b/LayerManagerService/include/LmScreenList.h @@ -0,0 +1,32 @@ +/*************************************************************************** + * + * Copyright 2010,2011 BMW Car IT GmbH + * Copyright (C) 2012 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh + * + * 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. + * + ****************************************************************************/ + +#ifndef _LMSCREENLIST_H_ +#define _LMSCREENLIST_H_ + +#include +#include "LmScreen.h" + +typedef std::list LmScreenList; +typedef std::list::iterator LmScreenListIterator; +typedef std::list::const_iterator LmScreenListConstIterator; +typedef std::list::reverse_iterator LmScreenListReverseIterator; +typedef std::list::const_reverse_iterator LmScreenListConstReverseIterator; + +#endif /* _LMSCREENLIST_H_ */ -- 2.7.4