LayerManagerService: Add LmScreen class
authorNobuhiko Tanibata <ntanibata@jp.adit-jv.com>
Wed, 9 Jan 2013 01:56:56 +0000 (10:56 +0900)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Wed, 9 Jan 2013 12:50:14 +0000 (04:50 -0800)
-LmScreen is a control class for controlling LayerRenderOrder

Signed-off-by: Nobuhiko Tanibata <ntanibata@jp.adit-jv.com>
LayerManagerService/include/LmScreen.h [new file with mode: 0644]
LayerManagerService/include/LmScreenList.h [new file with mode: 0644]

diff --git a/LayerManagerService/include/LmScreen.h b/LayerManagerService/include/LmScreen.h
new file mode 100644 (file)
index 0000000..aa68ba9
--- /dev/null
@@ -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/LayerManagerService/include/LmScreenList.h b/LayerManagerService/include/LmScreenList.h
new file mode 100644 (file)
index 0000000..e8c7031
--- /dev/null
@@ -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_ */