############################################################################
#
-# Copyright 2010-2012 BMW Car IT GmbH
+# Copyright 2012 BMW Car IT GmbH
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
#
############################################################################
+
cmake_minimum_required (VERSION 2.6)
+#===========================================================================
+# plugin configuration
+#===========================================================================
project(TextRenderer)
-find_package (Threads)
-
include_directories(
include
../../Base/include
${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
)
+set(LIBS
+ LayerManagerUtils
+ LayerManagerBase
+)
+
set(SRC_FILES
../../Base/src/BaseRenderer.cpp
src/TextRenderer.cpp
)
-set(LIBS
- ${LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- LayerManagerUtils
-)
+set(PLUGIN_INSTALL_PATH lib/layermanager/renderer)
+
+#===========================================================================
+# create statically linked plugin
+#===========================================================================
+if (WITH_STATIC_LIBRARIES)
-add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
+ add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
+ set (STATICALLY_LINKED_PLUGINS ${STATICALLY_LINKED_PLUGINS}
+ ${PROJECT_NAME} CACHE INTERNAL "list of static plugins")
+
+#===========================================================================
+# create dynamically linked plugin
+#===========================================================================
+else(WITH_STATIC_LIBRARIES)
+
+ add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
+
+ install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
+
+endif(WITH_STATIC_LIBRARIES)
+
+
+#===========================================================================
+# external libraries
+#===========================================================================
target_link_libraries(${PROJECT_NAME} ${LIBS})
-add_dependencies(${PROJECT_NAME}
- LayerManagerService
- LayerManagerUtils
-)
+add_dependencies(${PROJECT_NAME} ${LIBS})
-install(TARGETS ${PROJECT_NAME}
- DESTINATION lib/layermanager/renderer
-)
class TextRenderer : public BaseRenderer
{
public:
- TextRenderer(Scene* pScene);
+ TextRenderer(ICommandExecutor& executor, Configuration& config);
virtual ~TextRenderer();
void doScreenShot(std::string fileToSave);
void doScreenShotOfLayer(std::string fileToSave, uint id);
virtual bool setOptimizationMode(OptimizationType id, OptimizationModeType mode);
virtual bool getOptimizationMode(OptimizationType id, OptimizationModeType* mode);
+ // from PluginBase
+ virtual HealthCondition pluginGetHealth();
+ virtual t_ilm_const_string pluginGetName() const;
+
private:
uint m_width;
uint m_height;
****************************************************************************/
#include "TextRenderer.h"
-#include "config.h"
+#include "Configuration.h"
#include "Log.h"
#include <string.h>
#include <fstream>
-TextRenderer::TextRenderer(Scene* pScene)
-: BaseRenderer(pScene)
+TextRenderer::TextRenderer(ICommandExecutor& executor, Configuration& config)
+: BaseRenderer(executor, config)
, m_width(0)
, m_height(0)
{
return true;
}
-extern "C" IRenderer* createTextRenderer(Scene* pScene) {
- return new TextRenderer(pScene);
+HealthCondition TextRenderer::pluginGetHealth()
+{
+ return HealthRunning;
}
-extern "C" void destroyTextRenderer(TextRenderer* p)
+t_ilm_const_string TextRenderer::pluginGetName() const
{
- delete p;
+ return "TextRenderer";
}
+
+DECLARE_LAYERMANAGEMENT_PLUGIN(TextRenderer)