summaryrefslogtreecommitdiff
path: root/LayerManagerBase
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2012-11-30 04:52:52 -0800
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2013-01-14 00:34:16 -0800
commite3bc3c8a9cbfcc02f8f3b3f3fbc43196b776a763 (patch)
treeba22fbf3ce691105df11955b0b45e410256773fe /LayerManagerBase
parenta9153e8d70caefd88c1fae7701dfe25ff2d82579 (diff)
downloadlayer_management-e3bc3c8a9cbfcc02f8f3b3f3fbc43196b776a763.tar.gz
LayerManagerService: divided into LayerManagerBase and LayerManagerService
LayerManagerBase is a static library containing the whole LayerManager base implementation, e.g. Scene, PluginLoading, ... This allows other components to directly link to this implementation (e.g. unit tests) LayerManagerService contains only the main.cpp file and links to LayerManagerBase library. Additionally, some component dependencies have been improved. Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
Diffstat (limited to 'LayerManagerBase')
-rw-r--r--LayerManagerBase/include/LmScreen.h91
-rw-r--r--LayerManagerBase/include/LmScreenList.h32
2 files changed, 123 insertions, 0 deletions
diff --git a/LayerManagerBase/include/LmScreen.h b/LayerManagerBase/include/LmScreen.h
new file mode 100644
index 0000000..aa68ba9
--- /dev/null
+++ b/LayerManagerBase/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 <pthread.h>
+#include <string.h>
+
+/*
+ * 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/LayerManagerBase/include/LmScreenList.h b/LayerManagerBase/include/LmScreenList.h
new file mode 100644
index 0000000..e8c7031
--- /dev/null
+++ b/LayerManagerBase/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 <list>
+#include "LmScreen.h"
+
+typedef std::list<LmScreen*> LmScreenList;
+typedef std::list<LmScreen*>::iterator LmScreenListIterator;
+typedef std::list<LmScreen*>::const_iterator LmScreenListConstIterator;
+typedef std::list<LmScreen*>::reverse_iterator LmScreenListReverseIterator;
+typedef std::list<LmScreen*>::const_reverse_iterator LmScreenListConstReverseIterator;
+
+#endif /* _LMSCREENLIST_H_ */