summaryrefslogtreecommitdiff
path: root/ivi-layermanagement-examples
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-01-31 13:42:10 +0100
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-01-31 13:42:10 +0100
commit11968937b90d4cf3f84edcb4bad1e7b84a6fb061 (patch)
tree890fbb1dbe7a02d103ae89ac5605bd5e256c13d3 /ivi-layermanagement-examples
parent70833645706d167b351e1b0f65bfe8ec3da1efe9 (diff)
downloadwayland-ivi-extension-11968937b90d4cf3f84edcb4bad1e7b84a6fb061.tar.gz
removed obsolete code and build scripts
- removed LayerSceneDescriptionExample - removed LayerManagerUtils - removed config project - updated build system Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
Diffstat (limited to 'ivi-layermanagement-examples')
-rw-r--r--ivi-layermanagement-examples/CMakeLists.txt1
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt10
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/include/IlmMatrix.h (renamed from ivi-layermanagement-examples/LayerManagerUtils/include/IlmMatrix.h)0
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/include/LayerScene.h (renamed from ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerScene.h)0
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/src/IlmMatrix.cpp (renamed from ivi-layermanagement-examples/LayerManagerUtils/src/IlmMatrix.cpp)0
-rw-r--r--ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt3
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/CMakeLists.txt84
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/include/Bitmap.h26
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/include/IpcModule.h107
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/include/IpcModuleLoader.h75
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/include/Log.h132
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/include/LogMessageBuffer.h126
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/include/ThreadBase.h55
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/src/Bitmap.cpp102
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/src/IpcModuleLoader.cpp189
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/src/Log.cpp268
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/src/LogMessageBuffer.cpp189
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/src/ThreadBase.cpp231
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/tests/BitmapTest.cpp71
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/tests/CMakeLists.txt52
-rw-r--r--ivi-layermanagement-examples/LayerManagerUtils/tests/LogTest.cpp134
-rw-r--r--ivi-layermanagement-examples/LayerSceneDescriptionExample/CMakeLists.txt22
-rw-r--r--ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerSceneProvider.h44
-rw-r--r--ivi-layermanagement-examples/LayerSceneDescriptionExample/src/LayerSceneProvider.cpp130
24 files changed, 4 insertions, 2047 deletions
diff --git a/ivi-layermanagement-examples/CMakeLists.txt b/ivi-layermanagement-examples/CMakeLists.txt
index 5a8d427..7cc3e7e 100644
--- a/ivi-layermanagement-examples/CMakeLists.txt
+++ b/ivi-layermanagement-examples/CMakeLists.txt
@@ -23,6 +23,5 @@ project (ivi-layermanagement-examples)
#===========================================================================================================
# cmake configuration
#===========================================================================================================
-add_subdirectory(LayerManagerUtils)
add_subdirectory(LayerManagerControl)
add_subdirectory(EGLWLMockNavigation)
diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt b/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt
index 3720b88..7d0ea43 100644
--- a/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/CMakeLists.txt
@@ -20,8 +20,6 @@
cmake_minimum_required (VERSION 2.6)
-project_type(EXAMPLE)
-
find_package(PkgConfig)
pkg_check_modules(GLESv2 glesv2 REQUIRED)
pkg_check_modules(EGL egl REQUIRED)
@@ -36,8 +34,6 @@ include_directories(
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmClient/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include"
"include"
- "../LayerSceneDescriptionExample/include"
- "../LayerManagerUtils/include"
)
set (HEADER_FILES
@@ -70,6 +66,7 @@ set (SRC_FILES
src/ShaderLighting.cpp
src/main.cpp
src/WaylandServerinfoProtocol.cpp
+ src/IlmMatrix.cpp
)
add_executable(EGLWLMockNavigation
@@ -78,8 +75,10 @@ add_executable(EGLWLMockNavigation
)
add_dependencies(EGLWLMockNavigation
+ ilmCommon
ilmClient
- EGLWLMockNavigation LayerManagerUtils wayland-client
+ ilmControl
+ wayland-client
)
set(LIBS
@@ -88,7 +87,6 @@ set(LIBS
${WAYLAND_CLIENT_LIBRARIES}
${WAYLAND_EGL_LIBRARIES}
${EGL_LIBRARIES}
- LayerManagerUtils
ilmClient
ilmControl
)
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/IlmMatrix.h b/ivi-layermanagement-examples/EGLWLMockNavigation/include/IlmMatrix.h
index e0c606f..e0c606f 100644
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/IlmMatrix.h
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/include/IlmMatrix.h
diff --git a/ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerScene.h b/ivi-layermanagement-examples/EGLWLMockNavigation/include/LayerScene.h
index 21530b7..21530b7 100644
--- a/ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerScene.h
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/include/LayerScene.h
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/src/IlmMatrix.cpp b/ivi-layermanagement-examples/EGLWLMockNavigation/src/IlmMatrix.cpp
index 5e50b6c..5e50b6c 100644
--- a/ivi-layermanagement-examples/LayerManagerUtils/src/IlmMatrix.cpp
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/src/IlmMatrix.cpp
diff --git a/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt b/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt
index 62136b4..4b83eff 100644
--- a/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt
+++ b/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt
@@ -18,14 +18,12 @@
############################################################################
project (LayerManagerControl)
-project_type(CORE)
include_directories(
include
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmClient/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmControl/include"
- "${CMAKE_SOURCE_DIR}/ivi-layermanagement-example/LayerManagerUtils/include"
)
add_executable(${PROJECT_NAME}
@@ -46,7 +44,6 @@ add_executable(${PROJECT_NAME}
add_dependencies(${PROJECT_NAME}
ilmClient
ilmControl
- LayerManagerUtils
)
target_link_libraries(${PROJECT_NAME} ilmClient ilmControl)
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/CMakeLists.txt b/ivi-layermanagement-examples/LayerManagerUtils/CMakeLists.txt
deleted file mode 100644
index 12521c3..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/CMakeLists.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-############################################################################
-#
-# Copyright 2010, 2011 BMW Car IT 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.
-#
-############################################################################
-
-cmake_minimum_required (VERSION 2.6)
-
-project(LayerManagerUtils)
-project_type(CORE)
-
-find_package (Threads)
-
-add_library(${PROJECT_NAME} STATIC
- src/Bitmap.cpp
- src/IlmMatrix.cpp
- src/Log.cpp
- src/LogMessageBuffer.cpp
- src/ThreadBase.cpp
- src/IpcModuleLoader.cpp
-)
-
-set(INCLUDE_DIRS
- "include"
- "${CMAKE_SOURCE_DIR}/config"
- "${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include"
-)
-
-set(LIBS
- ${LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- dl
-)
-
-if (WITH_DLT)
-
- find_package(AutomotiveDlt REQUIRED)
-
- set(INCLUDE_DIRS
- ${INCLUDE_DIRS}
- ${DLT_INCLUDE_DIR}
- )
-
- set(LIBS
- ${LIBS}
- ${DLT_LIBRARY}
- )
-
- target_link_libraries(${PROJECT_NAME} ${LIBS})
-
-endif (WITH_DLT)
-
-include_directories(${INCLUDE_DIRS})
-
-install(FILES
- include/Log.h
- include/LogMessageBuffer.h
- include/IlmMatrix.h
- include/Bitmap.h
- include/IpcModuleLoader.h
- DESTINATION
- include/layermanager
-)
-
-install(TARGETS
- ${PROJECT_NAME}
- DESTINATION
- lib/layermanager/static
-)
-
-add_subdirectory(tests)
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/Bitmap.h b/ivi-layermanagement-examples/LayerManagerUtils/include/Bitmap.h
deleted file mode 100644
index ec6a1d7..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/Bitmap.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT 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 _BITMAP_H_
-#define _BITMAP_H_
-
-#include <string>
-
-void writeBitmap(std::string FileName, char* imagedataRGB, int width, int height);
-
-#endif /*_BITMAP_H_ */
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/IpcModule.h b/ivi-layermanagement-examples/LayerManagerUtils/include/IpcModule.h
deleted file mode 100644
index ff0e959..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/IpcModule.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2012 BMW Car IT 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 __IPCMODULE_H__
-#define __IPCMODULE_H__
-
-#include "ilm_types.h"
-
-/*
-=============================================================================
- initialization
-=============================================================================
-*/
-t_ilm_bool initClientMode();
-t_ilm_bool initServiceMode();
-
-/*
-=============================================================================
- create new messages
-=============================================================================
-*/
-t_ilm_message createMessage(t_ilm_const_string);
-t_ilm_message createResponse(t_ilm_message);
-t_ilm_message createErrorResponse(t_ilm_message);
-t_ilm_message createNotification(t_ilm_const_string);
-
-/*
-=============================================================================
- add content to message
-=============================================================================
-*/
-t_ilm_bool appendBool(t_ilm_message, const t_ilm_bool);
-t_ilm_bool appendDouble(t_ilm_message, const double);
-t_ilm_bool appendString(t_ilm_message, const char*);
-t_ilm_bool appendInt(t_ilm_message, const int);
-t_ilm_bool appendIntArray(t_ilm_message, const int*, int);
-t_ilm_bool appendUint(t_ilm_message, const unsigned int);
-t_ilm_bool appendUintArray(t_ilm_message, const unsigned int*, int);
-
-/*
-=============================================================================
- send message
-=============================================================================
-*/
-t_ilm_bool sendToClients(t_ilm_message, t_ilm_client_handle*, int);
-t_ilm_bool sendToService(t_ilm_message);
-
-/*
-=============================================================================
- receive message
-=============================================================================
-*/
-t_ilm_message receive(t_ilm_int); /* timeout in ms*/
-
-/*
-=============================================================================
- get message information
-=============================================================================
-*/
-t_ilm_const_string getMessageName(t_ilm_message);
-t_ilm_message_type getMessageType(t_ilm_message);
-t_ilm_const_string getSenderName(t_ilm_message);
-t_ilm_client_handle getSenderHandle(t_ilm_message);
-
-/*
-=============================================================================
- get content of message
-=============================================================================
-*/
-t_ilm_bool getBool(t_ilm_message, t_ilm_bool*);
-t_ilm_bool getDouble(t_ilm_message, double*);
-t_ilm_bool getString(t_ilm_message, char*);
-t_ilm_bool getInt(t_ilm_message, int*);
-t_ilm_bool getIntArray(t_ilm_message, int**, int*);
-t_ilm_bool getUint(t_ilm_message, unsigned int*);
-t_ilm_bool getUintArray(t_ilm_message, unsigned int**, int*);
-
-/*
-=============================================================================
- destroy message
-=============================================================================
-*/
-t_ilm_bool destroyMessage(t_ilm_message);
-
-/*
-=============================================================================
- shutdown
-=============================================================================
-*/
-t_ilm_bool destroy();
-
-#endif /* __IPCMODULE_H__*/
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/IpcModuleLoader.h b/ivi-layermanagement-examples/LayerManagerUtils/include/IpcModuleLoader.h
deleted file mode 100644
index 0e1952e..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/IpcModuleLoader.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2012 BMW Car IT 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 __IPCMODULELOADER_H_
-#define __IPCMODULELOADER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus*/
-
-#include "ilm_types.h"
-
-struct IpcModule
-{
- t_ilm_bool (*initClientMode)();
- t_ilm_bool (*initServiceMode)();
-
- t_ilm_message (*createMessage)(t_ilm_const_string);
- t_ilm_message (*createResponse)(t_ilm_message);
- t_ilm_message (*createErrorResponse)(t_ilm_message);
- t_ilm_message (*createNotification)(t_ilm_const_string);
-
- t_ilm_bool (*appendBool)(t_ilm_message, const t_ilm_bool);
- t_ilm_bool (*appendDouble)(t_ilm_message, const double);
- t_ilm_bool (*appendString)(t_ilm_message, const char*);
- t_ilm_bool (*appendInt)(t_ilm_message, const int);
- t_ilm_bool (*appendIntArray)(t_ilm_message, const int*, int);
- t_ilm_bool (*appendUint)(t_ilm_message, const unsigned int);
- t_ilm_bool (*appendUintArray)(t_ilm_message, const unsigned int*, int);
-
- t_ilm_bool (*sendToClients)(t_ilm_message, t_ilm_client_handle*, int);
- t_ilm_bool (*sendToService)(t_ilm_message);
-
- t_ilm_message (*receive)(t_ilm_int); /* timeout in ms*/
-
- t_ilm_const_string (*getMessageName)(t_ilm_message);
- t_ilm_message_type (*getMessageType)(t_ilm_message);
- t_ilm_const_string (*getSenderName)(t_ilm_message);
- t_ilm_client_handle (*getSenderHandle)(t_ilm_message);
-
- t_ilm_bool (*getBool)(t_ilm_message, t_ilm_bool*);
- t_ilm_bool (*getDouble)(t_ilm_message, double*);
- t_ilm_bool (*getString)(t_ilm_message, char*);
- t_ilm_bool (*getInt)(t_ilm_message, int*);
- t_ilm_bool (*getIntArray)(t_ilm_message, int**, int*);
- t_ilm_bool (*getUint)(t_ilm_message, unsigned int*);
- t_ilm_bool (*getUintArray)(t_ilm_message, unsigned int**, int*);
-
- t_ilm_bool (*destroyMessage)(t_ilm_message);
-
- t_ilm_bool (*destroy)();
-};
-
-t_ilm_bool loadIpcModule(struct IpcModule* communicator);
-
-#ifdef __cplusplus
-} /* extern "C"*/
-#endif /* __cplusplus*/
-
-#endif /* __IPCMODULELOADER_H_*/
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/Log.h b/ivi-layermanagement-examples/LayerManagerUtils/include/Log.h
deleted file mode 100644
index 3d96d30..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/Log.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
-* Copyright (C) 2011 BMW Car IT GmbH.
-* Author: Michael Schuldt (michael.schuldt@bmw-carit.de)
-*
-* 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.
-*
-* This file incorporates work covered by the following copyright and
-* permission notice:
-* Apache log4cxx
-* Copyright 2004-2007 The Apache Software Foundation
-*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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 _LOG_H_
-#define _LOG_H_
-#include "LogMessageBuffer.h"
-#include <iostream>
-#include <fstream>
-#include <pthread.h>
-#include <map>
-typedef enum
-{
- LOG_DISABLED = 0,
- LOG_ERROR = 1,
- LOG_INFO = 2,
- LOG_WARNING = 3,
- LOG_DEBUG = 4,
- LOG_MAX_LEVEL
-} LOG_MODES;
-
-/*The log context content is configuration dependend. Due
- to the fact that we don't want to share the config file
- in development headers, the real context is established
- during the compiliation phase*/
-typedef void* LogContext;
-
-/* Diagnostic Injection Callback function to wrap dlt_injections for usage with c++ class names */
-typedef void (*diagnosticInjectionCallback)(unsigned int module_id, void *data, unsigned int length, void* userdata);
-
-class Log
-{
-public:
-
- typedef struct diagnosticCallbackData_t
- {
- unsigned int module_id;
- void *userdata;
- diagnosticInjectionCallback diagFunc;
- } diagnosticCallbackData;
-
- typedef std::map<unsigned int, diagnosticCallbackData*> DiagnosticCallbackMap;
-
- virtual ~Log();
- static LOG_MODES fileLogLevel;
- static LOG_MODES consoleLogLevel;
- static LOG_MODES dltLogLevel;
- static Log* getInstance();
- static DiagnosticCallbackMap* getDiagnosticCallbackMap()
- {
- return getInstance()->m_diagnosticCallbackMap;
- }
- void warning(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output);
- void info(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output);
- void error(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output);
- void debug(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output);
- void log(LogContext logContext, LOG_MODES logMode, const std::string& moduleName, const std::basic_string<char>& output);
- void registerDiagnosticInjectionCallback(unsigned int module_id, diagnosticInjectionCallback diagFunc, void* userdata);
- void unregisterDiagnosticInjectionCallback(unsigned int module_id);
- LogContext getLogContext();
- static void closeInstance();
-private:
- Log();
- void LogToFile(std::string logMode, const std::string& moduleName, const std::basic_string<char>& output);
- void LogToConsole(std::string logMode, const std::string& moduleName, const std::basic_string<char>& output);
- void LogToDltDaemon(LogContext logContext, LOG_MODES logMode, const std::string& moduleName, const std::basic_string<char>& output);
-
-private:
- std::ofstream* m_fileStream;
- pthread_mutex_t m_LogBufferMutex;
- LogContext m_logContext;
- static DiagnosticCallbackMap* m_diagnosticCallbackMap;
-
- static Log* m_instance;
-};
-
-//#define LOG_ERROR(logcontext,module, message)
-
-#define LOG_ERROR(module, message) { \
- LogMessageBuffer oss_; \
- Log::getInstance()->error(Log::getInstance()->getLogContext(), module, oss_.str(oss_<< message)); }
-
-//#define LOG_INFO(logcontext,module, message)
-
-#define LOG_INFO(module, message) { \
- LogMessageBuffer oss_; \
- Log::getInstance()->info(Log::getInstance()->getLogContext(), module, oss_.str(oss_<< message)); }
-
-//#define LOG_DEBUG(logcontext,module, message)
-
-#define LOG_DEBUG(module, message) { \
- LogMessageBuffer oss_; \
- Log::getInstance()->debug(Log::getInstance()->getLogContext(), module, oss_.str(oss_<< message)); }
-
-//#define LOG_WARNING(logcontext,module, message)
-
-#define LOG_WARNING(module, message) { \
- LogMessageBuffer oss_; \
- Log::getInstance()->warning(Log::getInstance()->getLogContext(), module, oss_.str(oss_<< message)); }
-#endif /* _LOG_H_ */
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/LogMessageBuffer.h b/ivi-layermanagement-examples/LayerManagerUtils/include/LogMessageBuffer.h
deleted file mode 100644
index aca6166..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/LogMessageBuffer.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/***************************************************************************
-* Copyright (C) 2011 BMW Car IT GmbH.
-* Author: Michael Schuldt (michael.schuldt@bmw-carit.de)
-*
-* 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.
-*
-* This file incorporates work covered by the following copyright and
-* permission notice:
-* Apache log4cxx
-* Copyright 2004-2007 The Apache Software Foundation
-*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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 _LOGMESSAGEBUFFER_H_
-#define _LOGMESSAGEBUFFER_H_
-
-#include <sstream>
-#include <pthread.h>
-typedef std::ios_base& (*ios_base_manip)(std::ios_base&);
-
-class LogMessageBuffer
-{
-public:
- /**
- * Creates a new instance.
- */
- LogMessageBuffer();
- /**
- * Destructor.
- */
- ~LogMessageBuffer();
-
- LogMessageBuffer& operator<<(const std::basic_string<char>& msg);
-
- LogMessageBuffer& operator<<(const char* msg);
-
- LogMessageBuffer& operator<<(char* msg);
-
- LogMessageBuffer& operator<<(const char msg);
-
- std::ostream& operator<<(ios_base_manip manip);
-
- std::ostream& operator<<(bool val);
-
- std::ostream& operator<<(short val);
-
- std::ostream& operator<<(int val);
-
- std::ostream& operator<<(unsigned int val);
-
- std::ostream& operator<<(long val);
-
- std::ostream& operator<<(unsigned long val);
-
- std::ostream& operator<<(float val);
-
- std::ostream& operator<<(double val);
-
- std::ostream& operator<<(long double val);
-
- std::ostream& operator<<(void* val);
-
- /**
- * Cast to ostream.
- */
- operator std::basic_ostream<char>&();
-
- const std::basic_string<char>& str(std::basic_ostream<char>& os);
-
- const std::basic_string<char>& str() const;
-
- bool hasStream() const;
-
-private:
- /**
- * No default copy constructor.
- */
- LogMessageBuffer(const LogMessageBuffer&);
-
- /**
- * No assignment operator.
- */
- LogMessageBuffer& operator=(const LogMessageBuffer&);
-
- /**
- * Encapsulated std::string.
- */
- std::basic_string<char> buf;
-
- /**
- * Encapsulated stream, created on demand.
- */
- std::basic_ostringstream<char>* stream;
-};
-
-template<class V>
-std::basic_ostream<char>& operator<<(LogMessageBuffer& os, const V& val)
-{
- return ((std::basic_ostream<char>&) os) << val;
-}
-
-#endif /* _LOGMESSAGEBUFFER_H_ */
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/include/ThreadBase.h b/ivi-layermanagement-examples/LayerManagerUtils/include/ThreadBase.h
deleted file mode 100644
index 77cc7b5..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/include/ThreadBase.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT 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 __THREADBASE_H__
-#define __THREADBASE_H__
-
-#include "ilm_types.h"
-#include <pthread.h>
-
-class ThreadBase
-{
-public:
- ThreadBase();
- virtual ~ThreadBase();
-
- t_ilm_bool threadCreate();
- t_ilm_bool threadInit();
- t_ilm_bool threadStart();
- t_ilm_bool threadStop();
-
- pthread_t threadGetId() const;
- t_ilm_bool threadIsRunning();
-
- // override in inheriting class if required
- virtual t_ilm_bool threadInitInThreadContext();
- virtual t_ilm_bool threadDestroyInThreadContext();
-
- // implement in inheriting class
- virtual t_ilm_bool threadMainLoop() = 0;
-
-private:
- static unsigned int mGlobalThreadCount;
- pthread_t mThreadId;
- pthread_mutex_t mInitLock;
- pthread_mutex_t mRunLock;
- t_ilm_bool mRunning;
-};
-
-#endif // __THREADBASE_H__
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/src/Bitmap.cpp b/ivi-layermanagement-examples/LayerManagerUtils/src/Bitmap.cpp
deleted file mode 100644
index e0910ab..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/src/Bitmap.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT 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.
-*
-****************************************************************************/
-#include "Bitmap.h"
-#include "Log.h"
-#include <stdint.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <string>
-#include <stdlib.h>
-
-typedef struct BMPHeaderStruct
-{
- uint32_t size; // filesize
- uint16_t a;
- uint16_t b;
- uint32_t offset; // offset
-} BMPHeader;
-
-typedef struct headerStruct
-{
- uint32_t headersize;
- int32_t width;
- int32_t height;
- uint16_t planes;
- uint16_t bits;
- uint32_t compress;
- uint32_t imagesize;
- int32_t xresolution;
- int32_t yresolution;
- uint32_t color1;
- uint32_t color2;
-} InfoHeader;
-
-void writeBitmap(std::string FileName, char* imagedataRGB, int width, int height)
-{
- LOG_DEBUG("Bitmap", "writing Bitmap to file:" << FileName);
-
- BMPHeader bmpHeader;
- InfoHeader header;
- int imagebytes = width*height*3;
- char firstbytes[2];
- firstbytes[0] = 'B';
- firstbytes[1] = 'M';
- bmpHeader.size = 2 + sizeof(BMPHeader) + sizeof(header) + imagebytes;
- bmpHeader.a = 0;
- bmpHeader.b = 0;
- bmpHeader.offset = 2 + sizeof(BMPHeader) + sizeof(header);
- header.headersize = sizeof(header);
- header.width = width;
- header.height = height;
- header.planes = 1;
- header.bits = 24; // bitmap does not do alpha
- header.compress = 0;
- header.imagesize = imagebytes;
- header.xresolution = 2835; // because of dpi
- header.yresolution = 2835;
- header.color1 = 0;
- header.color2 = 0;
-
- // make sure parent directory exists
- std::size_t currentPos = 0;
- std::size_t lastPos = FileName.find_first_of("/", currentPos);
- while (lastPos != std::string::npos)
- {
- std::string directory = FileName.substr(0, lastPos);
- LOG_DEBUG("Bitmap", "Creating directory " << directory);
- mkdir(directory.c_str(), 0755);
- currentPos = lastPos;
- lastPos = FileName.find_first_of("/", currentPos + 1);
- }
-
- FILE* file = fopen(FileName.c_str(), "wb");
-
- if (file)
- {
- fwrite(firstbytes, 2, 1, file);
- fwrite((void*)&bmpHeader, sizeof(BMPHeader), 1, file);
- fwrite((void*)&header, sizeof(header), 1, file);
- fwrite(imagedataRGB, header.imagesize, 1, file);
- fclose(file);
- }
- else
- {
- LOG_DEBUG("Bitmap", "File could not be opened for writing");
- }
-}
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/src/IpcModuleLoader.cpp b/ivi-layermanagement-examples/LayerManagerUtils/src/IpcModuleLoader.cpp
deleted file mode 100644
index c5bf8dd..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/src/IpcModuleLoader.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2012 BMW Car IT 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.
- *
- ****************************************************************************/
-#include "IpcModuleLoader.h"
-#include "IpcModule.h"
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <dirent.h> /* DIR*/
-#include <string.h> /* strcpy, strcat, strstr*/
-
-/*
-=============================================================================
- global variables
-=============================================================================
-*/
-const char* gDefaultPluginLookupPath = CMAKE_INSTALL_PREFIX"/lib/layermanager";
-const char* gCommunicatorPluginDirectory = "ipcmodules";
-
-/*
-=============================================================================
- plugin loading
-=============================================================================
-*/
-t_ilm_bool loadSymbolTable(struct IpcModule* ipcModule, char* path, char* file)
-{
- struct ApiFunction
- {
- const char* name;
- void** funcPtr;
- };
-
- struct ApiFunction ApiFunctionTable[] =
- {
- { "initClientMode", (void**)&ipcModule->initClientMode },
- { "initServiceMode", (void**)&ipcModule->initServiceMode },
-
- { "createMessage", (void**)&ipcModule->createMessage },
- { "createResponse", (void**)&ipcModule->createResponse },
- { "createErrorResponse", (void**)&ipcModule->createErrorResponse },
- { "createNotification", (void**)&ipcModule->createNotification },
-
- { "appendBool", (void**)&ipcModule->appendBool },
- { "appendDouble", (void**)&ipcModule->appendDouble },
- { "appendString", (void**)&ipcModule->appendString },
- { "appendInt", (void**)&ipcModule->appendInt },
- { "appendIntArray", (void**)&ipcModule->appendIntArray },
- { "appendUint", (void**)&ipcModule->appendUint },
- { "appendUintArray", (void**)&ipcModule->appendUintArray },
-
- { "sendToClients", (void**)&ipcModule->sendToClients },
- { "sendToService", (void**)&ipcModule->sendToService },
-
- { "receive", (void**)&ipcModule->receive },
-
- { "getMessageName", (void**)&ipcModule->getMessageName },
- { "getMessageType", (void**)&ipcModule->getMessageType },
- { "getSenderName", (void**)&ipcModule->getSenderName },
- { "getSenderHandle", (void**)&ipcModule->getSenderHandle },
-
- { "getBool", (void**)&ipcModule->getBool },
- { "getDouble", (void**)&ipcModule->getDouble },
- { "getString", (void**)&ipcModule->getString },
- { "getInt", (void**)&ipcModule->getInt },
- { "getIntArray", (void**)&ipcModule->getIntArray },
- { "getUint", (void**)&ipcModule->getUint },
- { "getUintArray", (void**)&ipcModule->getUintArray },
-
- { "destroyMessage", (void**)&ipcModule->destroyMessage },
-
- { "destroy", (void**)&ipcModule->destroy }
- };
-
- const unsigned int apiFunctionCount = sizeof(ApiFunctionTable) / sizeof(struct ApiFunction);
- unsigned int symbolCount = 0;
- t_ilm_bool returnValue = ILM_FALSE;
- void* pluginLibHandle = 0;
- char fullFilePath[1024];
- fullFilePath[0] = '\0';
-
- snprintf(fullFilePath, sizeof(fullFilePath), "%s/%s", path, file);
-
- pluginLibHandle = dlopen(fullFilePath, RTLD_LAZY);
-
- if (pluginLibHandle)
- {
- unsigned int i = 0;
- for (i = 0; i < apiFunctionCount; ++i)
- {
- struct ApiFunction* func = &ApiFunctionTable[i];
-
- *func->funcPtr = dlsym(pluginLibHandle, func->name);
- if (*func->funcPtr)
- {
- symbolCount++;
- /*printf("[ OK ] symbol %s\n", func->name);*/
- }
- else
- {
- /*printf("[FAIL] symbol %s\n", func->name);*/
- }
- }
- }
-
- if (symbolCount == apiFunctionCount)
- {
- returnValue = ILM_TRUE;
- }
- else
- {
- printf("Error in %s: found %d symbols, expected %d symbols.\n", fullFilePath, symbolCount, apiFunctionCount);
- if (0 != errno)
- {
- printf("--> error: %s\n", strerror(errno));
- }
- printf("--> not a valid ipc module\n");
- if (pluginLibHandle)
- {
- dlclose(pluginLibHandle);
- }
- }
-
- /*
- * Note: will break plugin. must be done during shutdown,
- * but currently there is no unloadIpcModule
- * dlclose(pluginLibHandle);
- */
-
- return returnValue;
-}
-
-t_ilm_bool loadIpcModule(struct IpcModule* communicator)
-{
- t_ilm_bool result = ILM_FALSE;
- char path[1024];
- DIR *directory;
-
- /* find communicator client plugin*/
- char* pluginLookupPath = getenv("LM_PLUGIN_PATH");
- if (pluginLookupPath)
- {
- gDefaultPluginLookupPath = pluginLookupPath;
- }
-
- snprintf(path, sizeof(path), "%s/%s", gDefaultPluginLookupPath,
- gCommunicatorPluginDirectory);
-
- /* open directory*/
- directory = opendir(path);
- if (directory)
- {
- /* iterate content of directory*/
- struct dirent *itemInDirectory = 0;
- while ((itemInDirectory = readdir(directory)) && !result)
- {
- char* fileName = itemInDirectory->d_name;
-
- if (strstr(fileName, ".so"))
- {
- result = loadSymbolTable(communicator, path, fileName);
- }
- }
-
- closedir(directory);
- }
- else
- {
- printf("IpcModuleLoader: Error opening plugin dir %s\n", path);
- }
-
- return result;
-}
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/src/Log.cpp b/ivi-layermanagement-examples/LayerManagerUtils/src/Log.cpp
deleted file mode 100644
index 7528849..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/src/Log.cpp
+++ /dev/null
@@ -1,268 +0,0 @@
-/***************************************************************************
-* Copyright (C) 2011 BMW Car IT GmbH.
-* Author: Michael Schuldt (michael.schuldt@bmw-carit.de)
-*
-* 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.
-*
-* This file incorporates work covered by the following copyright and
-* permission notice:
-* Apache log4cxx
-* Copyright 2004-2007 The Apache Software Foundation
-*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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.
-*/
-
-#include "Log.h"
-#include <iomanip>
-#include "config.h"
-#ifdef WITH_DLT
-#include <dlt/dlt.h>
-#endif
-
-Log* Log::m_instance = NULL;
-Log::DiagnosticCallbackMap* Log::m_diagnosticCallbackMap = NULL;
-LOG_MODES Log::fileLogLevel = LOG_DISABLED;
-LOG_MODES Log::consoleLogLevel = LOG_INFO;
-#ifdef WITH_DLT
-LOG_MODES Log::dltLogLevel = LOG_DEBUG;
-#else
-LOG_MODES Log::dltLogLevel = LOG_DISABLED;
-#endif
-
-
-Log::Log()
-{
- // TODO Auto-generated constructor stub
- m_fileStream = new std::ofstream("/tmp/LayerManagerService.log");
- pthread_mutex_init(&m_LogBufferMutex, NULL);
- Log::m_diagnosticCallbackMap = new Log::DiagnosticCallbackMap;
-#ifdef WITH_DLT
- m_logContext = new DltContext;
- DLT_REGISTER_APP("LMSA", "LayerManagerService");
- DLT_REGISTER_CONTEXT(*((DltContext*)m_logContext), "LMSC", "LayerManagerService");
- DLT_SET_APPLICATION_LL_TS_LIMIT(DLT_LOG_VERBOSE, DLT_TRACE_STATUS_DEFAULT);
-#else
- m_logContext = NULL;
-#endif
-}
-
-Log* Log::getInstance()
-{
- if (m_instance == NULL)
- {
- m_instance = new Log();
- }
- return m_instance;
-}
-
-void Log::closeInstance()
-{
- delete m_instance;
- m_instance = NULL;
-}
-
-Log::~Log()
-{
- // TODO Auto-generated destructor stub
- m_fileStream->close();
- pthread_mutex_destroy(&m_LogBufferMutex);
- Log::m_instance = NULL;
-#ifdef WITH_DLT
- DLT_UNREGISTER_CONTEXT(*((DltContext*)m_logContext));
- delete((DltContext*)m_logContext);
- DLT_UNREGISTER_APP();
-#endif
- delete m_diagnosticCallbackMap;
- m_diagnosticCallbackMap = NULL;
- m_logContext = NULL;
-}
-
-void Log::warning(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output)
-{
- log(logContext, LOG_WARNING, moduleName, output);
-}
-
-void Log::info(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output)
-{
- log(logContext, LOG_INFO, moduleName, output);
-}
-
-void Log::error(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output)
-{
- log(logContext, LOG_ERROR, moduleName, output);
-}
-
-void Log::debug(LogContext logContext, const std::string& moduleName, const std::basic_string<char>& output)
-{
- log(logContext, LOG_DEBUG, moduleName, output);
-}
-
-void Log::log(LogContext logContext, LOG_MODES logMode, const std::string& moduleName, const std::basic_string<char>& output)
-{
- (void)logContext;
-
- std::string logString[LOG_MAX_LEVEL] = {"", "ERROR", "INFO", "WARNING", "DEBUG"};
- std::string logOutLevelString = logString[LOG_INFO];
- pthread_mutex_lock(&m_LogBufferMutex);
- if (logMode < LOG_MAX_LEVEL)
- {
- logOutLevelString = logString[logMode];
- }
- if (consoleLogLevel >= logMode)
- {
- LogToConsole(logOutLevelString, moduleName, output);
- }
- if (fileLogLevel >= logMode)
- {
- LogToFile(logOutLevelString, moduleName, output);
- }
-#ifdef WITH_DLT
- if (dltLogLevel >= logMode)
- {
- LogToDltDaemon(logContext, logMode, moduleName, output);
- }
-#endif
- pthread_mutex_unlock(&m_LogBufferMutex);
-}
-
-void Log::LogToFile(std::string logMode, const std::string& moduleName, const std::basic_string<char>& output)
-{
- static unsigned int maxLengthModuleName = 0;
- static unsigned int maxLengthLogModeName = 0;
-
- if (moduleName.length() > maxLengthModuleName)
- {
- maxLengthModuleName = moduleName.length();
- }
-
- if (logMode.length() > maxLengthLogModeName)
- {
- maxLengthLogModeName = logMode.length();
- }
-
- *m_fileStream << std::setw(maxLengthModuleName) << std::left << moduleName << " | "
- << std::setw(maxLengthLogModeName) << std::left << logMode << " | "
- << output << std::endl;
-}
-
-void Log::LogToConsole(std::string logMode, const std::string& moduleName, const std::basic_string<char>& output)
-{
- static unsigned int maxLengthModuleName = 0;
- static unsigned int maxLengthLogModeName = 0;
-
- if (moduleName.length() > maxLengthModuleName)
- {
- maxLengthModuleName = moduleName.length();
- }
-
- if (logMode.length() > maxLengthLogModeName)
- {
- maxLengthLogModeName = logMode.length();
- }
-
- std::cout << std::setw(maxLengthModuleName) << std::left << moduleName << " | "
- << std::setw(maxLengthLogModeName) << std::left << logMode << " | "
- << output << std::endl;
-}
-
-LogContext Log::getLogContext()
-{
- return m_logContext;
-}
-
-#ifdef WITH_DLT
-int dlt_injection_callback(unsigned int module_id, void *data, unsigned int length)
-{
- LOG_DEBUG("LOG", "Injection for service " << module_id << " called");
- Log::diagnosticCallbackData *cbData = (*Log::getDiagnosticCallbackMap())[module_id];
- if (cbData)
- {
- cbData->diagFunc(module_id, data, length, cbData->userdata);
- }
- return 0;
-}
-#endif
-
-void Log::registerDiagnosticInjectionCallback(unsigned int module_id, diagnosticInjectionCallback diagFunc, void* userdata)
-{
- Log::diagnosticCallbackData *cbData = new Log::diagnosticCallbackData;
- cbData->module_id = module_id;
- cbData->userdata = userdata;
- cbData->diagFunc = diagFunc;
- (*m_diagnosticCallbackMap)[module_id] = cbData;
-#ifdef WITH_DLT
- DLT_REGISTER_INJECTION_CALLBACK(*(DltContext*)m_logContext, module_id, dlt_injection_callback);
-#endif
-}
-
-void Log::unregisterDiagnosticInjectionCallback(unsigned int module_id)
-{
- m_diagnosticCallbackMap->erase(module_id);
-}
-
-#ifdef WITH_DLT
-
-// DLT macros will fail using -pedantic with
-// warning: ISO C++ forbids braced-groups within expressions
-#pragma GCC diagnostic ignored "-pedantic"
-
-void Log::LogToDltDaemon(LogContext logContext, LOG_MODES logMode, const std::string& moduleName, const std::basic_string<char>& output)
-{
- std::stringstream oss;
- std::string dltString;
- static unsigned int maxLengthModuleName = 0;
-
- if (moduleName.length() > maxLengthModuleName)
- {
- maxLengthModuleName = moduleName.length();
- }
- oss << std::setw(maxLengthModuleName) << std::left << moduleName << " | "
- << output << std::endl;
- dltString = oss.str();
-
- switch (logMode)
- {
- case LOG_INFO:
- DLT_LOG(*((DltContext*)logContext), DLT_LOG_INFO, DLT_STRING(dltString.c_str()));
- break;
-
- case LOG_ERROR:
- DLT_LOG(*((DltContext*)logContext), DLT_LOG_ERROR, DLT_STRING(dltString.c_str()));
- break;
-
- case LOG_DEBUG:
- DLT_LOG(*((DltContext*)logContext), DLT_LOG_DEBUG, DLT_STRING(dltString.c_str()));
- break;
-
- case LOG_WARNING:
- DLT_LOG(*((DltContext*)logContext), DLT_LOG_WARN, DLT_STRING(dltString.c_str()));
- break;
-
- default:
- DLT_LOG(*((DltContext*)logContext), DLT_LOG_INFO, DLT_STRING(dltString.c_str()));
- }
-}
-#endif
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/src/LogMessageBuffer.cpp b/ivi-layermanagement-examples/LayerManagerUtils/src/LogMessageBuffer.cpp
deleted file mode 100644
index e1b07f5..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/src/LogMessageBuffer.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/***************************************************************************
-* Copyright (C) 2011 BMW Car IT GmbH.
-* Author: Michael Schuldt (michael.schuldt@bmw-carit.de)
-*
-* 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.
-*
-* This file incorporates work covered by the following copyright and
-* permission notice:
-* Apache log4cxx
-* Copyright 2004-2007 The Apache Software Foundation
-*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You 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.
-*/
-
-#include "LogMessageBuffer.h"
-
-LogMessageBuffer::LogMessageBuffer()
-: stream(0)
-{
-}
-
-LogMessageBuffer::~LogMessageBuffer()
-{
- if (stream)
- {
- delete stream;
- }
-}
-
-LogMessageBuffer& LogMessageBuffer::operator<<(const std::basic_string<char>& msg)
-{
- if (stream)
- {
- *stream << msg;
- }
- else
- {
- buf.append(msg);
- }
- return *this;
-}
-
-LogMessageBuffer& LogMessageBuffer::operator<<(const char* msg)
-{
- const char* actualMsg = msg;
- if (!actualMsg)
- {
- actualMsg = "null";
- }
-
- if (stream)
- {
- *stream << actualMsg;
- }
- else
- {
- buf.append(actualMsg);
- }
- return *this;
-}
-
-LogMessageBuffer& LogMessageBuffer::operator<<(char* msg)
-{
- return operator<<((const char*) msg);
-}
-
-LogMessageBuffer& LogMessageBuffer::operator<<(const char msg)
-{
- if (stream)
- {
- buf.assign(1, msg);
- *stream << buf;
- }
- else
- {
- buf.append(1, msg);
- }
- return *this;
-}
-
-LogMessageBuffer::operator std::basic_ostream<char>&()
-{
- if (!stream)
- {
- stream = new std::basic_ostringstream<char>();
-
- if (!buf.empty())
- {
- *stream << buf;
- }
- }
- return *stream;
-}
-
-const std::basic_string<char>& LogMessageBuffer::str(std::basic_ostream<char>&)
-{
- buf = stream->str();
- return buf;
-}
-
-const std::basic_string<char>& LogMessageBuffer::str() const
-{
- return buf;
-}
-
-bool LogMessageBuffer::hasStream() const
-{
- return (stream != 0);
-}
-
-std::ostream& LogMessageBuffer::operator<<(ios_base_manip manip)
-{
- std::ostream& s = *this;
- (*manip)(s);
- return s;
-}
-
-std::ostream& LogMessageBuffer::operator<<(bool val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(short val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(int val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(unsigned int val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(long val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(unsigned long val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(float val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(double val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(long double val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
-
-std::ostream& LogMessageBuffer::operator<<(void* val)
-{
- return ((std::ostream&) *this).operator<<(val);
-}
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/src/ThreadBase.cpp b/ivi-layermanagement-examples/LayerManagerUtils/src/ThreadBase.cpp
deleted file mode 100644
index 202fd28..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/src/ThreadBase.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT 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.
- *
- ****************************************************************************/
-
-#include "ThreadBase.h"
-#include "Log.h"
-#include <stdlib.h>
-#include <pthread.h>
-#include <signal.h>
-
-//===========================================================================
-// internal data structures
-//===========================================================================
-struct ThreadArgument
-{
- ThreadBase* obj;
- pthread_mutex_t* initLock;
- pthread_mutex_t* runLock;
- t_ilm_bool* running;
-};
-
-//===========================================================================
-// static member initialization
-//===========================================================================
-unsigned int ThreadBase::mGlobalThreadCount = 1; // main thread already running
-
-//===========================================================================
-// global thread cleanup function (automatically called on thread shutwon)
-//===========================================================================
-static void threadBaseMainLoopCleanup(void* arg)
-{
- // destroy in thread context
- ((ThreadArgument*)arg)->obj->threadDestroyInThreadContext();
- pthread_mutex_unlock(((ThreadArgument*)arg)->runLock);
- *(((ThreadArgument*)arg)->running) = ILM_FALSE;
- delete((ThreadArgument*)arg);
-}
-
-//===========================================================================
-// global thread loop function
-//===========================================================================
-static void* threadBaseMainLoop(void* arg)
-{
- if (!arg)
- {
- LOG_ERROR("ThreadBase", "invalid thread argument (arg)");
- return NULL;
- }
-
- if (!((ThreadArgument*)arg)->obj)
- {
- LOG_ERROR("ThreadBase", "invalid thread argument (obj)");
- return NULL;
- }
-
- if (!((ThreadArgument*)arg)->running)
- {
- LOG_ERROR("ThreadBase", "invalid thread argument (running)");
- return NULL;
- }
-
- // register cleanup function
- pthread_cleanup_push(threadBaseMainLoopCleanup, arg);
-
- // init in thread context
- *(((ThreadArgument*)arg)->running) = ((ThreadArgument*)arg)->obj->threadInitInThreadContext();
-
- // indicate initialization complete
- pthread_mutex_unlock(((ThreadArgument*)arg)->initLock);
-
- // wait for start permit
- pthread_mutex_lock(((ThreadArgument*)arg)->runLock);
-
- // run thread
- while (*(((ThreadArgument*)arg)->running))
- {
- *(((ThreadArgument*)arg)->running) = ((ThreadArgument*)arg)->obj->threadMainLoop();
- }
-
- // execute cleanup handlers
- pthread_cleanup_pop(1);
-
- return NULL;
-}
-
-//===========================================================================
-// class implementation
-//===========================================================================
-ThreadBase::ThreadBase()
-: mThreadId(0)
-, mRunning(ILM_FALSE)
-{
- pthread_mutex_init(&mRunLock, NULL);
- pthread_mutex_lock(&mRunLock);
-
- pthread_mutex_init(&mInitLock, NULL);
- pthread_mutex_lock(&mInitLock);
-}
-
-ThreadBase::~ThreadBase()
-{
- pthread_mutex_unlock(&mInitLock);
- pthread_mutex_destroy(&mInitLock);
-
- pthread_mutex_unlock(&mRunLock);
- pthread_mutex_destroy(&mRunLock);
-}
-
-pthread_t ThreadBase::threadGetId() const
-{
- return mThreadId;
-}
-
-t_ilm_bool ThreadBase::threadIsRunning()
-{
- if (0 == pthread_mutex_trylock(&mRunLock))
- {
- pthread_mutex_unlock(&mRunLock);
- mRunning = ILM_FALSE;
- }
- if (0 != pthread_kill(mThreadId, 0))
- {
- mRunning = ILM_FALSE;
- }
- return mRunning;
-}
-
-t_ilm_bool ThreadBase::threadCreate()
-{
- pthread_attr_t notificationThreadAttributes;
- pthread_attr_init(&notificationThreadAttributes);
- pthread_attr_setdetachstate(&notificationThreadAttributes,
- PTHREAD_CREATE_JOINABLE);
-
- ThreadArgument* arg = new ThreadArgument();
- arg->obj = this;
- arg->runLock = &mRunLock;
- arg->initLock = &mInitLock;
- arg->running = &mRunning;
-
- int ret = pthread_create(&mThreadId,
- &notificationThreadAttributes,
- threadBaseMainLoop,
- (void*)arg);
- if (0 != ret)
- {
- LOG_ERROR("ThreadBase", "Failed to start thread.");
- }
- else
- {
- ++mGlobalThreadCount;
- LOG_DEBUG("ThreadBase", "Started thread (now " << mGlobalThreadCount << ")");
- mRunning = ILM_TRUE;
- }
-
- return threadIsRunning();
-}
-
-t_ilm_bool ThreadBase::threadInit()
-{
- return (0 == pthread_mutex_lock(&mInitLock)) ? ILM_TRUE : ILM_FALSE;
-}
-
-t_ilm_bool ThreadBase::threadStart()
-{
- return (0 == pthread_mutex_unlock(&mRunLock)) ? ILM_TRUE : ILM_FALSE;
-}
-
-t_ilm_bool ThreadBase::threadStop()
-{
- t_ilm_bool result = ILM_TRUE;
-
- mRunning = threadIsRunning();
-
- if (mRunning)
- {
- LOG_INFO("ThreadBase", "pthread_cancel");
- if (0 != pthread_cancel(mThreadId))
- {
- LOG_ERROR("ThreadBase", "Stopping thread failed (cancel)");
- result = ILM_FALSE;
- }
- else
- {
- LOG_INFO("ThreadBase", "pthread_join");
- if (0 != pthread_join(mThreadId, NULL))
- {
- LOG_ERROR("ThreadBase", "Stopping thread failed (join)");
- result = ILM_FALSE;
- }
- }
- }
-
- if (result)
- {
- --mGlobalThreadCount;
- LOG_DEBUG("ThreadBase", "Stopped thread (now " << mGlobalThreadCount << ")");
- }
-
- return result;
-}
-
-//=====================================================================================
-// base implementation for overriding in inheriting classes
-//=====================================================================================
-t_ilm_bool ThreadBase::threadInitInThreadContext()
-{
- LOG_DEBUG("ThreadBase", "threadInitInThreadContext (default implementation)");
- return ILM_TRUE;
-}
-
-t_ilm_bool ThreadBase::threadDestroyInThreadContext()
-{
- LOG_DEBUG("ThreadBase", "threadDestroyInThreadContext (default implementation)");
- return ILM_TRUE;
-}
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/tests/BitmapTest.cpp b/ivi-layermanagement-examples/LayerManagerUtils/tests/BitmapTest.cpp
deleted file mode 100644
index a02ee4f..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/tests/BitmapTest.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT 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.
- *
- ****************************************************************************/
-
-
-#include <gtest/gtest.h>
-#include <stdio.h>
-
-#include "Bitmap.h"
-
-#define WIDTH 1
-#define HEIGHT 1
-
-char* imageData = new char[3];
-
-bool fileExists(std::string filename)
-{
- struct stat stFileInfo;
- int status = stat(filename.c_str(),&stFileInfo);
- return status == 0;
-}
-
-TEST(BitmapTest, WriteBitmapIntoCurrentDirectory) {
- const char* filename = "test.bmp";
- writeBitmap(filename, imageData, WIDTH, HEIGHT);
-
- ASSERT_TRUE(fileExists(filename));
-}
-
-TEST(BitmapTest, WriteBitmapIntoAbsoluteDirectory) {
- const char* filename = "/tmp/test2.bmp";
- writeBitmap(filename, imageData, WIDTH, HEIGHT);
-
- ASSERT_TRUE(fileExists(filename));
-}
-
-TEST(BitmapTest, WriteBitmapIntoNonExistingRelativeDirectory) {
- const char* filename = "./testa/testb/testc/test2.bmp";
- writeBitmap(filename, imageData, WIDTH, HEIGHT);
-
- ASSERT_TRUE(fileExists(filename));
-}
-
-TEST(BitmapTest, WriteBitmapIntoNonExistingAbsoluteDirectory) {
- const char* filename = "/tmp/testa/testb/test2.bmp";
- writeBitmap(filename, imageData, WIDTH, HEIGHT);
-
- ASSERT_TRUE(fileExists(filename));
-}
-
-TEST(BitmapTest, WriteToFileOrDirectoryNotAllowed) {
- const char* invalidFile = "//invalid";
- writeBitmap(invalidFile, imageData, 1, 1);
-
- // this test ensures that if the bitmap is not writeable nothing else happens
-}
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/tests/CMakeLists.txt b/ivi-layermanagement-examples/LayerManagerUtils/tests/CMakeLists.txt
deleted file mode 100644
index aaccf48..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/tests/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-############################################################################
-#
-# Copyright 2010, 2011 BMW Car IT 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.
-#
-############################################################################
-
-cmake_minimum_required (VERSION 2.6)
-
-if (WITH_TESTS)
-
- enable_testing()
-
- project(LayerManagerUtils_Test)
- project_type(TEST)
-
- set(LIBS
- ${LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- LayerManagerUtils
- dl
- gtest
- )
-
- include_directories(${INCLUDE_DIRS})
-
- add_executable(${PROJECT_NAME}
- BitmapTest.cpp
- LogTest.cpp
- )
-
- target_link_libraries(${PROJECT_NAME} ${LIBS})
-
- install(TARGETS ${PROJECT_NAME}
- DESTINATION bin
- )
-
- add_test(LayerManagerUtils ${PROJECT_NAME})
-
-endif(WITH_TESTS)
diff --git a/ivi-layermanagement-examples/LayerManagerUtils/tests/LogTest.cpp b/ivi-layermanagement-examples/LayerManagerUtils/tests/LogTest.cpp
deleted file mode 100644
index 013901c..0000000
--- a/ivi-layermanagement-examples/LayerManagerUtils/tests/LogTest.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT 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.
- *
- ****************************************************************************/
-
-
-#include <gtest/gtest.h>
-#include <stdio.h>
-
-#include "Log.h"
-
-#define WIDTH 1
-#define HEIGHT 1
-
-std::string moduleName = "TheModuleName";
-std::string logFileName = "/tmp/LayerManagerService.log";
-int i=0;
-
-bool checkLogFileForMessage(std::string message)
-{
- std::string line;
- std::ifstream logFile(logFileName.c_str());
-
- if (logFile.is_open())
- {
- while ( logFile.good() )
- {
- getline (logFile,line);
- int position = line.find(message);
- if (position >0)
- return true;
- }
- logFile.close();
- }
- // did not find the message in any line of the logfile
- return false;
-}
-
-
-TEST(LogTest, writeAWarning) {
- Log::getInstance()->fileLogLevel = LOG_MAX_LEVEL;
- LOG_WARNING(moduleName, "writeAWarning");
-
- ASSERT_TRUE(checkLogFileForMessage("writeAWarning"));
-}
-
-TEST(LogTest, writeAnError) {
- Log::getInstance()->fileLogLevel = LOG_INFO;
- LOG_ERROR(moduleName, "writeAnError");
-
- ASSERT_TRUE(checkLogFileForMessage("writeAnError"));
-}
-
-TEST(LogTest, writeAnInformation) {
- Log::getInstance()->fileLogLevel = LOG_INFO;
- LOG_INFO(moduleName, "writeAnInformation");
-
- ASSERT_TRUE(checkLogFileForMessage("writeAnInformation"));
-}
-
-
-TEST(LogTest, logSomethingWithLowerLogLevel) {
-
- // when disabled, nothing should ever be logged
- Log::getInstance()->fileLogLevel = LOG_DISABLED;
- LOG_ERROR(moduleName, "err1");
- ASSERT_FALSE(checkLogFileForMessage("err1"));
-
- LOG_DEBUG(moduleName, "debug1");
- ASSERT_FALSE(checkLogFileForMessage("debug1"));
-
- LOG_WARNING(moduleName, "warn1");
- ASSERT_FALSE(checkLogFileForMessage("warn1"));
-
- LOG_INFO(moduleName, "info1");
- ASSERT_FALSE(checkLogFileForMessage("info1"));
-
- // when error is set, only higher levels may be logged
- Log::getInstance()->fileLogLevel = LOG_ERROR;
- LOG_ERROR(moduleName, "err2");
- ASSERT_TRUE(checkLogFileForMessage("err2"));
-
- LOG_DEBUG(moduleName, "debug2");
- ASSERT_FALSE(checkLogFileForMessage("debug2"));
-
- LOG_WARNING(moduleName, "warn2");
- ASSERT_FALSE(checkLogFileForMessage("warn2"));
-
- LOG_INFO(moduleName, "info2");
- ASSERT_FALSE(checkLogFileForMessage("info2"));
-
- // when debug is set, only higher levels may be logged
- Log::getInstance()->fileLogLevel = LOG_DEBUG;
- LOG_ERROR(moduleName, "err3");
- ASSERT_TRUE(checkLogFileForMessage("err3"));
-
- LOG_DEBUG(moduleName, "debug3");
- ASSERT_TRUE(checkLogFileForMessage("debug3"));
-
- LOG_WARNING(moduleName, "warn3");
- ASSERT_TRUE(checkLogFileForMessage("warn3"));
-
- LOG_INFO(moduleName, "info3");
- ASSERT_TRUE(checkLogFileForMessage("info3"));
-
- // when info is set, only higher levels may be logged
- Log::getInstance()->fileLogLevel = LOG_INFO;
- LOG_ERROR(moduleName, "err4");
- ASSERT_TRUE(checkLogFileForMessage("err4"));
-
- LOG_DEBUG(moduleName, "debug4");
- ASSERT_FALSE(checkLogFileForMessage("debug4"));
-
- LOG_WARNING(moduleName, "warn4");
- ASSERT_FALSE(checkLogFileForMessage("warn4"));
-
- LOG_INFO(moduleName, "info4");
- ASSERT_TRUE(checkLogFileForMessage("info4"));
-
-}
diff --git a/ivi-layermanagement-examples/LayerSceneDescriptionExample/CMakeLists.txt b/ivi-layermanagement-examples/LayerSceneDescriptionExample/CMakeLists.txt
deleted file mode 100644
index 590af2c..0000000
--- a/ivi-layermanagement-examples/LayerSceneDescriptionExample/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-############################################################################
-#
-# Copyright 2010, 2011 BMW Car IT 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.
-#
-
-############################################################################
-
-# examples was moved to
-# <src_root>/LayerManagerPlugins/SceneProvider/ExampleSceneProvider \ No newline at end of file
diff --git a/ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerSceneProvider.h b/ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerSceneProvider.h
deleted file mode 100644
index 832ac2b..0000000
--- a/ivi-layermanagement-examples/LayerSceneDescriptionExample/include/LayerSceneProvider.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT 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 _LAYERSCENEPROVIDER_H_
-#define _LAYERSCENEPROVIDER_H_
-
-#include "ISceneProvider.h"
-
-class ICommandExecutor;
-
-/**
- * scene Providers to setup a inital layer scenary on target platform
- */
-class ExampleSceneProvider : public ISceneProvider
-{
-public:
-
- ExampleSceneProvider(ICommandExecutor* executor);
- virtual ~ExampleSceneProvider() {}
- /**
- * Delegate Scene : this method will be called on LayerManager startup
- * to delegate a initial scene description of Layers on the target Platform
- */
- virtual bool delegateScene();
-};
-
-
-#endif /* _LAYERSCENEPROVIDER_H_ */
diff --git a/ivi-layermanagement-examples/LayerSceneDescriptionExample/src/LayerSceneProvider.cpp b/ivi-layermanagement-examples/LayerSceneDescriptionExample/src/LayerSceneProvider.cpp
deleted file mode 100644
index 8374014..0000000
--- a/ivi-layermanagement-examples/LayerSceneDescriptionExample/src/LayerSceneProvider.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT 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.
- *
- ****************************************************************************/
-
-#include "LayerSceneProvider.h"
-#include "ICommandExecutor.h"
-#include "CommitCommand.h"
-#include "LayerCreateCommand.h"
-#include "LayerSetDestinationRectangleCommand.h"
-#include "LayerSetSourceRectangleCommand.h"
-#include "LayerSetVisibilityCommand.h"
-#include "LayerSetOpacityCommand.h"
-#include "ScreenSetRenderOrderCommand.h"
-#include "LayerScene.h"
-#include "SurfaceCreateCommand.h"
-#include "SurfaceSetVisibilityCommand.h"
-#include "SurfaceSetOpacityCommand.h"
-#include <unistd.h>
-
-ExampleSceneProvider::LayerSceneProvider(ICommandExecutor* executor)
-: ISceneProvider(executor)
-{
-}
-
-typedef struct t_layerScene
-{
- unsigned int layer;
- bool visibility;
- float opacity;
-} layerScene;
-
-typedef struct t_surfaceScene
-{
- unsigned int surface;
- bool visibility;
- float opacity;
-} surfaceScene;
-
-
-static layerScene gInitialLayerScene[] =
-{
- { LAYER_EXAMPLE_VIDEO_APPLICATIONS, true, 1.0 },
- { LAYER_EXAMPLE_GLES_APPLICATIONS, true, 1.0 },
- { LAYER_EXAMPLE_X_APPLICATIONS, true, 1.0 }
-};
-
-static surfaceScene gInitialSurfaceScene[] =
-{
- { SURFACE_EXAMPLE_EGLX11_APPLICATION,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_1,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_2,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_3,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_4,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_5,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_6,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_7,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_8,false,1.0 },
- { SURFACE_EXAMPLE_GDTESTENV_APPLICATION_9,false,1.0 },
- { SURFACE_EXAMPLE_GLXX11_APPLICATION,false,1.0 },
- { SURFACE_EXAMPLE_EGLRAW_APPLICATION,false,1.0 },
- { SURFACE_EXAMPLE_VIDEO_APPLICATION,false,1.0 }
-};
-
-
-bool ExampleSceneProvider::delegateScene()
-{
- bool result = true;
- pid_t layermanagerPid = getpid();
- int i = 0;
- int numberOfLayers = sizeof(gInitialLayerScene) / sizeof (layerScene);
- int numberOfSurfaces = sizeof(gInitialSurfaceScene) / sizeof (surfaceScene);
- unsigned int *renderOrder = new unsigned int [numberOfLayers];
- unsigned int* screenResolution = m_executor->getScreenResolution(0);
- if ( numberOfLayers > 0 )
- {
- /* setup inital layer scenery */
- for (i = 0;i<numberOfLayers;i++)
- {
- result &= m_executor->execute(new LayerCreateCommand(layermanagerPid, screenResolution[0], screenResolution[1], &(gInitialLayerScene[i].layer)));
- result &= m_executor->execute(new LayerSetSourceRectangleCommand(layermanagerPid, gInitialLayerScene[i].layer, 0, 0, screenResolution[0], screenResolution[1]));
- result &= m_executor->execute(new LayerSetDestinationRectangleCommand(layermanagerPid, gInitialLayerScene[i].layer, 0, 0, screenResolution[0], screenResolution[1]));
- result &= m_executor->execute(new LayerSetOpacityCommand(layermanagerPid, gInitialLayerScene[i].layer, gInitialLayerScene[i].opacity) );
- result &= m_executor->execute(new LayerSetVisibilityCommand(layermanagerPid, gInitialLayerScene[i].layer, gInitialLayerScene[i].visibility) );
- result &= m_executor->execute(new CommitCommand(layermanagerPid));
- renderOrder[i]=gInitialLayerScene[i].layer;
- }
- /* Finally set the first executed renderorder */
- result &= m_executor->execute(new ScreenSetRenderOrderCommand(layermanagerPid, 0, renderOrder, numberOfLayers));
- result &= m_executor->execute(new CommitCommand(layermanagerPid));
- }
-
- if ( numberOfSurfaces > 0 )
- {
- /* setup inital surface scenery */
- for (i = 0;i<numberOfSurfaces;i++)
- {
- result &= m_executor->execute(new SurfaceCreateCommand(layermanagerPid, &(gInitialSurfaceScene[i].surface)));
- result &= m_executor->execute(new SurfaceSetOpacityCommand(layermanagerPid, gInitialSurfaceScene[i].surface, gInitialSurfaceScene[i].opacity));
- result &= m_executor->execute(new SurfaceSetVisibilityCommand(layermanagerPid, gInitialSurfaceScene[i].surface, gInitialSurfaceScene[i].visibility));
- result &= m_executor->execute(new CommitCommand(layermanagerPid));
- }
- /* Finally set the first executed renderorder */
- }
- return result;
-}
-
-extern "C" ISceneProvider* createLayerScene(ICommandExecutor* executor)
-{
- return new ExampleSceneProvider(executor);
-}
-
-extern "C" void destroyLayerScene(ExampleSceneProvider* p)
-{
- delete p;
-}