tests/LayermanagerTest.cpp
tests/InputManagerTest.cpp
tests/GraphicalObjectTest.cpp
- tests/GraphicalGroupTest.cpp
tests/GraphicalSurfaceTest.cpp
tests/SurfaceTest.cpp
tests/LayerTest.cpp
+++ /dev/null
-/***************************************************************************
-*
-* 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 _GRAPHICALGROUP_H_
-#define _GRAPHICALGROUP_H_
-
-#include <list>
-#include "GraphicalObject.h"
-#include "ObjectType.h"
-
-/**
- * Containerclass grouping objects. Grouping makes it possible to call Commands on multiple targets(the group) at once.
- * @param T defines the element class. (Layergroup has Layer* as element type for instance)
- * @param FIRST_ID a group is parameterized by the first ID given to the group (counting upwards)
- */
-template <class T, ObjectType thetype>
-class GraphicalGroup : public GraphicalObject
-{
-public:
- GraphicalGroup(int creatorPid)
- : GraphicalObject(thetype, 1.0, true, creatorPid)
- {
- list = std::list<T*>();
- }
-
- GraphicalGroup(int externalId, int creatorPid)
- : GraphicalObject(externalId, thetype, 1.0, true, creatorPid)
- {
- list = std::list<T*>();
- }
-
- /**
- * Set visibility on every element of the group
- */
- virtual bool setVisibility(bool visible)
- {
- bool result = false;
- this->visibility = visible;
- for(typename std::list<T*>::iterator it = list.begin(); it != list.end(); ++it)
- {
- result |= (*it)->setVisibility(visible);
- }
- return result;
- }
-
- /**
- * Set opacity on every element of the group
- */
- virtual bool setOpacity(double opacity)
- {
- bool result = false;
- this->opacity = opacity;
- for(typename std::list<T*>::iterator it = list.begin(); it != list.end(); ++it)
- {
- result |= (*it)->setOpacity(opacity);
- }
- return result;
- }
-
- const std::list<T*> getList() const
- {
- return list;
- }
-
- void addElement(T* element)
- {
- list.push_back(element);
- }
-
- void removeElement(T* element)
- {
- list.remove(element);
- }
-
-private:
-
- // the list containing the elements represented by the group
- std::list<T*> list;
-};
-
-#endif /* _GRAPHICALGROUP_H_ */
#include <semaphore.h>
#include "Layer.h"
-#include "LayerGroup.h"
#include "Surface.h"
-#include "SurfaceGroup.h"
#include "LayerList.h"
#include "SurfaceMap.h"
#include "LmScreen.h"
*
* Represents a scene with screens which have Layers which contain the Surfaces.
* Sorting is based upon z-order of the contained layers.
- * Additionally surface and layer group can be used to apply attributes to multiple surfaces or layers at once.
*/
class IScene
{
virtual Surface* createSurface(const uint id, int creatorPid) = 0;
/**
- * \brief Create a new layer group within the scene.
- * \ingroup SceneAPI
- * \param[in] id id of the layer group
- * \param[in] creatorPid client process id that requested the creation of this layer group
- * \return pointer to layer group
- */
- virtual LayerGroup* createLayerGroup(const uint id, int creatorPid) = 0;
-
- /**
- * \brief Create a new surface group within the scene.
- * \ingroup SceneAPI
- * \param[in] id id of the new surface group
- * \param[in] creatorPid client process id that requested the creation of this surface group
- * \return pointer to surface group
- */
- virtual SurfaceGroup* createSurfaceGroup(const uint id, int creatorPid) = 0;
-
- /**
* \brief Remove a layer from the scene.
* \ingroup SceneAPI
* \param[in] layer pointer to layer
virtual Surface* getSurface(const uint id) = 0;
/**
- * \brief Get a surface group by id
- * \ingroup SceneAPI
- * \param[in] id id of surface group
- * \return pointer to surface group with id
- */
- virtual SurfaceGroup* getSurfaceGroup(const uint id) = 0;
-
- /**
- * \brief Get a layer group by id
- * \ingroup SceneAPI
- * \param[in] id id of the layer group
- * \return pointer to the layer group with id
- */
- virtual LayerGroup* getLayerGroup(const uint id) = 0;
-
- /**
* \brief Get list of ids of all layers currently existing.
* \ingroup SceneAPI
* \param[out] length length of array returned in array
virtual void getSurfaceIDs(uint* length, uint** array) const = 0;
/**
- * \brief Get list of ids of all layers currently existing.
- * \ingroup SceneAPI
- * \param[out] length length of array returned in array
- * \param[out] array array containing the ids of all layer groups
- * \return list of ids of all currently know layers
- */
- virtual void getLayerGroupIDs(uint* length, uint* array[]) const = 0;
-
- /**
- * \brief Get list of ids of all layers currently existing.
- * \ingroup SceneAPI
- * \param[out] length length of array returned in array
- * \param[out] array array containing the ids of all surface groups
- * \return list of ids of all currently know layers
- */
- virtual void getSurfaceGroupIDs(uint* length, uint* array[]) const = 0;
-
- /**
* \brief Lock the list for read and write access
* \ingroup SceneAPI
*/
virtual LmScreenList& getScreenList() = 0;
/**
- * \brief Remove a surface group from scene.
- * \ingroup SceneAPI
- * \param[in] surface pointer to surface to be removed
- */
- virtual void removeSurfaceGroup(SurfaceGroup *surface) = 0;
-
- /**
- * \brief Remove a layer group from scene.
- * \ingroup SceneAPI
- * \param[in] layer pointer to layer group to be removed
- */
- virtual void removeLayerGroup(LayerGroup *layer) = 0;
-
- /**
* \brief Get a map of all surface from the scene.
* \ingroup SceneAPI
* \return Map holding all surfaces.
+++ /dev/null
-/***************************************************************************
-*
-* 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 LAYERGROUP_H_
-#define LAYERGROUP_H_
-
-#include "GraphicalGroup.h"
-#include "Layer.h"
-
-typedef GraphicalGroup<Layer, TypeLayerGroup> LayerGroup;
-
-#endif /* LAYERGROUP_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 LAYERGROUPMAP_H_
-#define LAYERGROUPMAP_H_
-
-#include <map>
-#include "LayerGroup.h"
-
-typedef std::map<unsigned int, LayerGroup*> LayerGroupMap;
-typedef std::map<unsigned int, LayerGroup*>::iterator LayerGroupMapIterator;
-typedef std::map<unsigned int, LayerGroup*>::const_iterator LayerGroupMapConstIterator;
-
-#endif /* LAYERGROUPMAP_H_ */
{
TypeSurface = ILM_SURFACE,
TypeLayer = ILM_LAYER,
- TypeSurfaceGroup = ILM_SURFACEGROUP,
- TypeLayerGroup = ILM_LAYERGROUP,
TypeMax
};
#include "Layermanager.h"
#include "CommandList.h"
#include "ShaderMap.h"
-#include "LayerGroup.h"
-#include "LayerGroupMap.h"
-#include "SurfaceGroup.h"
-#include "SurfaceGroupMap.h"
#include "SurfaceMap.h"
#include "LayerMap.h"
#include "ShaderMap.h"
virtual Layer* createLayer(const uint id, int creatorPid);
virtual Surface *createSurface(const uint id, int creatorPid);
- virtual LayerGroup *createLayerGroup(const uint id, int creatorPid);
- virtual SurfaceGroup *createSurfaceGroup(const uint id, int creatorPid);
virtual bool removeLayer(Layer* layer);
virtual bool removeSurface(Surface* surface);
virtual LmScreen* getScreen(const uint id) const;
virtual Layer* getLayer(const uint id);
virtual Surface* getSurface(const uint id);
- virtual SurfaceGroup* getSurfaceGroup(const uint id);
- virtual LayerGroup* getLayerGroup(const uint id);
virtual void getLayerIDs(uint* length, uint** array) const;
virtual bool getLayerIDsOfScreen(const uint screenID, uint* length, uint** array) const;
- virtual void getSurfaceGroupIDs(uint* length, uint** array) const;
- virtual void getLayerGroupIDs(uint* length, uint** array) const;
virtual void getSurfaceIDs(uint* length, uint** array) const;
virtual void lockScene();
virtual void unlockScene();
virtual LayerList& getCurrentRenderOrder(const uint id);
- virtual void removeSurfaceGroup(SurfaceGroup *surface);
- virtual void removeLayerGroup(LayerGroup *layer);
virtual const SurfaceMap getAllSurfaces() const;
virtual bool isLayerInCurrentRenderOrder(const uint id);
const LayerMap getAllLayers() const;
private:
- void removeLayerFromAllLayerGroups(Layer* layer);
- void removeSurfaceFromAllSurfaceGroups(Surface* surface);
-
-private:
ShaderMap m_shaderMap;
pthread_mutex_t m_layerListMutex;
- LayerGroupMap m_layerGroupMap;
- SurfaceGroupMap m_surfaceGroupMap;
SurfaceMap m_surfaceMap;
LayerMap m_layerMap;
LayerList m_nullRenderOrder;
+++ /dev/null
-/***************************************************************************
-*
-* 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 SURFACEGROUP_H_
-#define SURFACEGROUP_H_
-
-#include "GraphicalGroup.h"
-#include "Surface.h"
-
-typedef GraphicalGroup<Surface, TypeSurfaceGroup> SurfaceGroup;
-
-#endif /* SURFACEGROUP_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 SURFACEGROUPMAP_H_
-#define SURFACEGROUPMAP_H_
-
-#include <map>
-#include "SurfaceGroup.h"
-
-typedef std::map<unsigned int, SurfaceGroup*> SurfaceGroupMap;
-typedef std::map<unsigned int, SurfaceGroup*>::iterator SurfaceGroupMapIterator;
-typedef std::map<unsigned int, SurfaceGroup*>::const_iterator SurfaceGroupMapConstIterator;
-
-
-#endif /* SURFACEGROUPMAP_H_ */
#include "GraphicalObject.h"
-unsigned int GraphicalObject::nextGraphicId[TypeMax]={1,1,1,1};
+unsigned int GraphicalObject::nextGraphicId[TypeMax]={1,1};
const unsigned int GraphicalObject::INVALID_ID=0xFFFFFFFF;
#include "Layer.h"
#include "Surface.h"
-#include "LayerGroup.h"
-#include "SurfaceGroup.h"
#include "Shader.h"
#include "Scene.h"
return newSurface;
}
-SurfaceGroup* Scene::createSurfaceGroup(const uint surfaceGroupId, int creatorPid)
-{
- SurfaceGroup* newSurfaceGroup = NULL;
- if (surfaceGroupId == GraphicalObject::INVALID_ID)
- {
- newSurfaceGroup = new SurfaceGroup(creatorPid);
- uint newSurfaceGroupId = newSurfaceGroup->getID();
- m_surfaceGroupMap[newSurfaceGroupId] = newSurfaceGroup;
- }
- else
- {
- if (0 == m_surfaceGroupMap.count(surfaceGroupId))
- {
- newSurfaceGroup = new SurfaceGroup(surfaceGroupId, creatorPid);
- uint newSurfaceGroupId = newSurfaceGroup->getID();
- m_surfaceGroupMap[newSurfaceGroupId] = newSurfaceGroup;
- }
- else
- {
- newSurfaceGroup = m_surfaceGroupMap[surfaceGroupId];
- }
- }
- return newSurfaceGroup;
-}
-
-LayerGroup* Scene::createLayerGroup(const uint layerGroupId, int creatorPid)
-{
- LayerGroup* newLayerGroup = NULL;
- if (layerGroupId == GraphicalObject::INVALID_ID)
- {
- newLayerGroup = new LayerGroup(creatorPid);
- uint newLayerGroupId = newLayerGroup->getID();
- m_layerGroupMap[newLayerGroupId] = newLayerGroup;
- }
- else
- {
- if (0 == m_layerGroupMap.count(layerGroupId))
- {
- newLayerGroup = new LayerGroup(layerGroupId, creatorPid);
- uint newLayerGroupId = newLayerGroup->getID();
- m_layerGroupMap[newLayerGroupId] = newLayerGroup;
- }
- else
- {
- newLayerGroup = m_layerGroupMap[layerGroupId];
- }
- }
- return newLayerGroup;
-}
-
-
LmScreen* Scene::getScreen(const uint screenId) const
{
LmScreenListConstIterator iter = m_screenList.begin();
return surface;
}
-SurfaceGroup* Scene::getSurfaceGroup(const uint surfaceGroupId)
-{
- SurfaceGroup* surfaceGroup = NULL;
- if (m_surfaceGroupMap.count(surfaceGroupId) > 0)
- {
- surfaceGroup = m_surfaceGroupMap[surfaceGroupId];
- }
- else
- {
- LOG_WARNING("Scene","SurfaceGroup not found : id [ " << surfaceGroupId << " ]");
- }
- return surfaceGroup;
-}
-
-LayerGroup* Scene::getLayerGroup(const uint layerGroupId)
-{
- LayerGroup* layerGroup = NULL;
- if (m_layerGroupMap.count(layerGroupId) > 0)
- {
- layerGroup = m_layerGroupMap[layerGroupId];
- }
- else
- {
- LOG_WARNING("Scene","LayerGroup not found : id [ " << layerGroupId << " ]");
- }
- return layerGroup;
-}
-
-/// \brief remove layer from all layergroups it might be part of
-void Scene::removeLayerFromAllLayerGroups(Layer* layer)
-{
- LayerGroupMapIterator iter = m_layerGroupMap.begin();
- LayerGroupMapIterator iterEnd = m_layerGroupMap.end();
-
- for (; iter != iterEnd; ++iter)
- {
- LayerGroup *lg = iter->second;
- lg->removeElement(layer);
- }
-}
-
/// \brief take layer out of list of layers
bool Scene::removeLayer(Layer* layer)
{
(*iter)->getCurrentRenderOrder().remove(layer);
}
m_layerMap.erase(layer->getID());
- removeLayerFromAllLayerGroups(layer);
delete layer;
}
return result;
}
-/// \brief remove surface from all surfacegroups it might be part of
-void Scene::removeSurfaceFromAllSurfaceGroups(Surface* surface)
-{
- SurfaceGroupMapIterator iter = m_surfaceGroupMap.begin();
- SurfaceGroupMapIterator iterEnd = m_surfaceGroupMap.end();
-
- for (; iter != iterEnd; ++iter)
- {
- SurfaceGroup *sg = iter->second;
- sg->removeElement(surface);
- }
-}
-
/// \brief take surface out of list of surfaces
bool Scene::removeSurface(Surface* surface)
{
}
m_surfaceMap.erase(surfaceId);
- removeSurfaceFromAllSurfaceGroups(surface);
-
delete surface;
}
return result;
}
+
/// \brief take removing applied native content
void Scene::removeSurfaceNativeContent(Surface* surface)
{
}
}
-void Scene::removeLayerGroup(LayerGroup* layerGroup)
-{
- if (layerGroup != NULL)
- {
- uint layerGroupId = layerGroup->getID();
- m_layerGroupMap.erase(layerGroupId);
- delete layerGroup;
- }
-}
-
-void Scene::removeSurfaceGroup(SurfaceGroup* surfaceGroup)
-{
- if (surfaceGroup != NULL)
- {
- uint surfaceGroupId = surfaceGroup->getID();
- m_surfaceGroupMap.erase(surfaceGroupId);
- delete surfaceGroup;
- }
-}
-
void Scene::getLayerIDs(uint* length, uint** array) const
{
uint numOfLayers = m_layerMap.size();
}
}
-void Scene::getSurfaceGroupIDs(uint* length, uint** array) const
-{
- uint numOfSurfaceGroups = m_surfaceGroupMap.size();
- uint arrayPos = 0;
-
- *length = numOfSurfaceGroups;
- *array = new uint[numOfSurfaceGroups]; // TODO: safe, if size = 0?
-
- SurfaceGroupMapConstIterator iter = m_surfaceGroupMap.begin();
- SurfaceGroupMapConstIterator iterEnd = m_surfaceGroupMap.end();
-
- for (; iter != iterEnd; ++iter)
- {
- (*array)[arrayPos] = (*iter).first;
- ++arrayPos;
- }
-}
-
-void Scene::getLayerGroupIDs(uint* length, uint** array) const
-{
- uint numOfLayergroups = m_layerGroupMap.size();
- uint arrayPos = 0;
-
- *length = numOfLayergroups;
- *array = new uint[numOfLayergroups]; // TODO: safe, if size = 0?
-
- LayerGroupMapConstIterator iter = m_layerGroupMap.begin();
- LayerGroupMapConstIterator iterEnd = m_layerGroupMap.end();
-
- for (; iter != iterEnd; ++iter)
- {
- (*array)[arrayPos] = (*iter).first;
- ++arrayPos;
- }
-}
-
bool Scene::isLayerInCurrentRenderOrder(const uint id)
{
LmScreenListIterator iterScreen = m_screenList.begin();
+++ /dev/null
-/***************************************************************************
- *
- * 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 "GraphicalGroup.h"
-#include "Layer.h"
-#include "LayerList.h"
-#include "Shader.h"
-
-class GraphicalGroupTest : public ::testing::Test
-{
-public:
- void SetUp()
- {
- m_pLayerGroup = new GraphicalGroup<Layer, TypeLayer>(0);
- m_pSurfaceGroup = new GraphicalGroup<Surface, TypeSurface>(0);
- ASSERT_TRUE(m_pLayerGroup);
- ASSERT_TRUE(m_pSurfaceGroup);
- }
-
- void TearDown()
- {
- if (m_pLayerGroup)
- {
- delete m_pLayerGroup;
- m_pLayerGroup = 0;
- }
- if (m_pSurfaceGroup)
- {
- delete m_pSurfaceGroup;
- m_pSurfaceGroup = 0;
- }
- }
-
- GraphicalGroup<Layer, TypeLayer>* m_pLayerGroup;
- GraphicalGroup<Surface, TypeSurface>* m_pSurfaceGroup;
-};
-
-TEST_F(GraphicalGroupTest, defaultConstructor_Layer)
-{
- GraphicalGroup<Layer, TypeLayer>* pLayerGroup = 0;
-
- /// create graphical group of type layer (= layer group)
- pLayerGroup = new GraphicalGroup<Layer, TypeLayer>(0);
-
- /// make sure, layer group was created
- ASSERT_TRUE(pLayerGroup);
-
- /// make sure, layer group is initially empty
- EXPECT_EQ(0u, pLayerGroup->getList().size());
-
- // cleanup
- if (pLayerGroup)
- {
- delete pLayerGroup;
- }
-}
-
-TEST_F(GraphicalGroupTest, defaultConstructor_Surface)
-{
- GraphicalGroup<Surface, TypeSurface>* pSurfaceGroup = 0;
-
- /// create graphical group of type surface (= surface group)
- pSurfaceGroup = new GraphicalGroup<Surface, TypeSurface>(0);
-
- /// make sure, surface group was created
- ASSERT_TRUE(pSurfaceGroup);
-
- /// make sure, surface group is initially empty
- EXPECT_EQ(0u, pSurfaceGroup->getList().size());
-
- // cleanup
- if (pSurfaceGroup)
- {
- delete pSurfaceGroup;
- }
-}
-
-TEST_F(GraphicalGroupTest, specialConstructor_Layer)
-{
- unsigned int expectedId = 433;
-
- GraphicalGroup<Layer, TypeLayer>* pLayerGroup = 0;
-
- /// create graphical group of type layer (= layer group) with expected id
- pLayerGroup = new GraphicalGroup<Layer, TypeLayer>(expectedId);
-
- /// make sure, layer group was created
- ASSERT_TRUE(pLayerGroup);
-
- /// make sure, layer group has expected id
- EXPECT_EQ(expectedId, pLayerGroup->getID());
-
- /// make sure, layer group is initially empty
- EXPECT_EQ(0u, pLayerGroup->getList().size());
-
- // cleanup
- if (pLayerGroup)
- {
- delete pLayerGroup;
- }
-}
-
-TEST_F(GraphicalGroupTest, specialConstructor_Surface)
-{
- unsigned int expectedId = 436;
-
- GraphicalGroup<Surface, TypeSurface>* pSurfaceGroup = 0;
-
- /// create graphical group of type surface (= surface group) with expected id
- pSurfaceGroup = new GraphicalGroup<Surface, TypeSurface>(expectedId);
-
- /// make sure, surface group was created
- ASSERT_TRUE(pSurfaceGroup);
-
- /// make sure, surface group has expected id
- EXPECT_EQ(expectedId, pSurfaceGroup->getID());
-
- /// make sure, surface group is initially empty
- EXPECT_EQ(0u, pSurfaceGroup->getList().size());
-
- // cleanup
- if (pSurfaceGroup)
- {
- delete pSurfaceGroup;
- }
-}
-
-TEST_F(GraphicalGroupTest, setVisibility_Layer)
-{
- /// create 3 layers
- Layer l1(0), l2(0), l3(0);
-
- /// set 2 layers to visible, one to invisible
- l1.setVisibility(true);
- l2.setVisibility(false);
- l3.setVisibility(true);
-
- /// make sure, two layers are visible, one is not
- EXPECT_TRUE(l1.getVisibility());
- EXPECT_FALSE(l2.getVisibility());
- EXPECT_TRUE(l3.getVisibility());
-
- /// add the 3 layers to layer group
- m_pLayerGroup->addElement(&l1);
- m_pLayerGroup->addElement(&l2);
- m_pLayerGroup->addElement(&l3);
-
- /// set layer group to invisible
- m_pLayerGroup->setVisibility(false);
-
- /// make sure, all layers are invisible
- EXPECT_FALSE(l1.getVisibility());
- EXPECT_FALSE(l2.getVisibility());
- EXPECT_FALSE(l3.getVisibility());
-
- /// set layer group to visible
- m_pLayerGroup->setVisibility(true);
-
- /// make sure, all layers are visible
- EXPECT_TRUE(l1.getVisibility());
- EXPECT_TRUE(l2.getVisibility());
- EXPECT_TRUE(l3.getVisibility());
-
- /// remove 2 layers from layer group
- m_pLayerGroup->removeElement(&l1);
- m_pLayerGroup->removeElement(&l2);
-
- /// set layer group to invisible
- m_pLayerGroup->setVisibility(false);
-
- /// make sure, only the visibility of one layer was changed
- EXPECT_TRUE(l1.getVisibility());
- EXPECT_TRUE(l2.getVisibility());
- EXPECT_FALSE(l3.getVisibility());
-}
-
-TEST_F(GraphicalGroupTest, setVisibility_Surface)
-{
- /// create 3 surfaces
- Surface l1(0), l2(0), l3(0);
-
- /// set 2 surfaces to visible, one to invisible
- l1.setVisibility(true);
- l2.setVisibility(false);
- l3.setVisibility(true);
-
- /// make sure, two surfaces are visible, one is not
- EXPECT_TRUE(l1.getVisibility());
- EXPECT_FALSE(l2.getVisibility());
- EXPECT_TRUE(l3.getVisibility());
-
- /// add the 3 surfaces to surface group
- m_pSurfaceGroup->addElement(&l1);
- m_pSurfaceGroup->addElement(&l2);
- m_pSurfaceGroup->addElement(&l3);
-
- /// set surface group to invisible
- m_pSurfaceGroup->setVisibility(false);
-
- /// make sure, all surfaces are invisible
- EXPECT_FALSE(l1.getVisibility());
- EXPECT_FALSE(l2.getVisibility());
- EXPECT_FALSE(l3.getVisibility());
-
- /// set surface group to visible
- m_pSurfaceGroup->setVisibility(true);
-
- /// make sure, all surfaces are visible
- EXPECT_TRUE(l1.getVisibility());
- EXPECT_TRUE(l2.getVisibility());
- EXPECT_TRUE(l3.getVisibility());
-
- /// remove 2 surfaces from surface group
- m_pSurfaceGroup->removeElement(&l1);
- m_pSurfaceGroup->removeElement(&l2);
-
- /// set surface group to invisible
- m_pSurfaceGroup->setVisibility(false);
-
- /// make sure, only the visibility of one surface was changed
- EXPECT_TRUE(l1.getVisibility());
- EXPECT_TRUE(l2.getVisibility());
- EXPECT_FALSE(l3.getVisibility());
-}
-
-TEST_F(GraphicalGroupTest, setOpacity_Layer)
-{
- /// create 3 layers
- Layer l1(0), l2(0), l3(0);
-
- /// set different opacity for each of the 3 layers
- l1.setOpacity(0.3);
- l2.setOpacity(0.6);
- l3.setOpacity(0.9);
-
- /// make sure, all layers have expected opacity
- EXPECT_DOUBLE_EQ(0.3, l1.getOpacity());
- EXPECT_DOUBLE_EQ(0.6, l2.getOpacity());
- EXPECT_DOUBLE_EQ(0.9, l3.getOpacity());
-
- /// add the 3 layers to layer group
- m_pLayerGroup->addElement(&l1);
- m_pLayerGroup->addElement(&l2);
- m_pLayerGroup->addElement(&l3);
-
- /// set layer group to expected opacity
- m_pLayerGroup->setOpacity(0.5);
-
- /// make sure, all layers have expected opacity now
- EXPECT_DOUBLE_EQ(0.5, l1.getOpacity());
- EXPECT_DOUBLE_EQ(0.5, l2.getOpacity());
- EXPECT_DOUBLE_EQ(0.5, l3.getOpacity());
-
- /// remove 2 layers from layer group
- m_pLayerGroup->removeElement(&l1);
- m_pLayerGroup->removeElement(&l2);
-
- /// set opacity of layer group to different value
- m_pLayerGroup->setOpacity(0.8);
-
- /// make sure, only the opacity of one layer was changed
- EXPECT_DOUBLE_EQ(0.5, l1.getOpacity());
- EXPECT_DOUBLE_EQ(0.5, l2.getOpacity());
- EXPECT_DOUBLE_EQ(0.8, l3.getOpacity());
-}
-
-TEST_F(GraphicalGroupTest, setOpacity_Surface)
-{
- /// create 3 surfaces
- Surface l1(0), l2(0), l3(0);
-
- /// set different opacity for each of the 3 surfaces
- l1.setOpacity(0.3);
- l2.setOpacity(0.6);
- l3.setOpacity(0.9);
-
- /// make sure, all surfaces have expected opacity
- EXPECT_DOUBLE_EQ(0.3, l1.getOpacity());
- EXPECT_DOUBLE_EQ(0.6, l2.getOpacity());
- EXPECT_DOUBLE_EQ(0.9, l3.getOpacity());
-
- /// add the 3 surfaces to surface group
- m_pSurfaceGroup->addElement(&l1);
- m_pSurfaceGroup->addElement(&l2);
- m_pSurfaceGroup->addElement(&l3);
-
- /// set surface group to expected opacity
- m_pSurfaceGroup->setOpacity(0.5);
-
- /// make sure, all surfaces have expected opacity now
- EXPECT_DOUBLE_EQ(0.5, l1.getOpacity());
- EXPECT_DOUBLE_EQ(0.5, l2.getOpacity());
- EXPECT_DOUBLE_EQ(0.5, l3.getOpacity());
-
- /// remove 2 surfaces from surface group
- m_pSurfaceGroup->removeElement(&l1);
- m_pSurfaceGroup->removeElement(&l2);
-
- /// set opacity of surface group to different value
- m_pSurfaceGroup->setOpacity(0.8);
-
- /// make sure, only the opacity of one surface was changed
- EXPECT_DOUBLE_EQ(0.5, l1.getOpacity());
- EXPECT_DOUBLE_EQ(0.5, l2.getOpacity());
- EXPECT_DOUBLE_EQ(0.8, l3.getOpacity());
-}
-
-TEST_F(GraphicalGroupTest, getList_Layer)
-{
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pLayerGroup->getList().size());
-
- /// add 3 layers to graphical group
- Layer l1(0), l2(0), l3(0);
- m_pLayerGroup->addElement(&l1);
- m_pLayerGroup->addElement(&l2);
- m_pLayerGroup->addElement(&l3);
-
- /// make sure, list not contains 3 elements
- EXPECT_EQ(3u, m_pLayerGroup->getList().size());
-
- /// remove 2 layers from graphical group
- m_pLayerGroup->removeElement(&l2);
- m_pLayerGroup->removeElement(&l3);
-
- /// make sure, list not contains 1 element
- EXPECT_EQ(1u, m_pLayerGroup->getList().size());
-
- /// remove last layers from graphical group
- m_pLayerGroup->removeElement(&l1);
-
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pLayerGroup->getList().size());
-}
-
-TEST_F(GraphicalGroupTest, getList_Surface)
-{
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pSurfaceGroup->getList().size());
-
- /// add 3 surfaces to graphical group
- Surface l1(0), l2(0), l3(0);
- m_pSurfaceGroup->addElement(&l1);
- m_pSurfaceGroup->addElement(&l2);
- m_pSurfaceGroup->addElement(&l3);
-
- /// make sure, list not contains 3 elements
- EXPECT_EQ(3u, m_pSurfaceGroup->getList().size());
-
- /// remove 2 surfaces from graphical group
- m_pSurfaceGroup->removeElement(&l2);
- m_pSurfaceGroup->removeElement(&l3);
-
- /// make sure, list not contains 1 element
- EXPECT_EQ(1u, m_pSurfaceGroup->getList().size());
-
- /// remove last surfaces from graphical group
- m_pSurfaceGroup->removeElement(&l1);
-
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pSurfaceGroup->getList().size());
-}
-
-TEST_F(GraphicalGroupTest, addElement_Layer)
-{
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pLayerGroup->getList().size());
-
- /// add 1 layer to graphical group
- Layer l1(0);
- m_pLayerGroup->addElement(&l1);
-
- /// make sure, list not contains 1 element
- EXPECT_EQ(1u, m_pLayerGroup->getList().size());
-
- /// add 2 layers to graphical group
- Layer l2(0), l3(0);
- m_pLayerGroup->addElement(&l2);
- m_pLayerGroup->addElement(&l3);
-
- /// make sure, list contains 3 element
- EXPECT_EQ(3u, m_pLayerGroup->getList().size());
-}
-
-TEST_F(GraphicalGroupTest, addElement_Surface)
-{
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pSurfaceGroup->getList().size());
-
- /// add 1 surface to graphical group
- Surface l1(0);
- m_pSurfaceGroup->addElement(&l1);
-
- /// make sure, list not contains 1 element
- EXPECT_EQ(1u, m_pSurfaceGroup->getList().size());
-
- /// add 2 surfaces to graphical group
- Surface l2(0), l3(0);
- m_pSurfaceGroup->addElement(&l2);
- m_pSurfaceGroup->addElement(&l3);
-
- /// make sure, list contains 3 element
- EXPECT_EQ(3u, m_pSurfaceGroup->getList().size());
-}
-
-TEST_F(GraphicalGroupTest, removeElement_Layer)
-{
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pLayerGroup->getList().size());
-
- /// add 3 layers to graphical group
- Layer l1(0), l2(0), l3(0);
- m_pLayerGroup->addElement(&l1);
- m_pLayerGroup->addElement(&l2);
- m_pLayerGroup->addElement(&l3);
-
- /// make sure, list not contains 3 elements
- EXPECT_EQ(3u, m_pLayerGroup->getList().size());
-
- /// remove 2 layers from graphical group
- m_pLayerGroup->removeElement(&l2);
- m_pLayerGroup->removeElement(&l3);
-
- /// make sure, list not contains 1 element
- EXPECT_EQ(1u, m_pLayerGroup->getList().size());
-
- /// remove last layers from graphical group
- m_pLayerGroup->removeElement(&l1);
-
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pLayerGroup->getList().size());
-}
-
-TEST_F(GraphicalGroupTest, removeElement_Surface)
-{
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pSurfaceGroup->getList().size());
-
- /// add 3 surfaces to graphical group
- Surface l1(0), l2(0), l3(0);
- m_pSurfaceGroup->addElement(&l1);
- m_pSurfaceGroup->addElement(&l2);
- m_pSurfaceGroup->addElement(&l3);
-
- /// make sure, list not contains 3 elements
- EXPECT_EQ(3u, m_pSurfaceGroup->getList().size());
-
- /// remove 2 surfaces from graphical group
- m_pSurfaceGroup->removeElement(&l2);
- m_pSurfaceGroup->removeElement(&l3);
-
- /// make sure, list not contains 1 element
- EXPECT_EQ(1u, m_pSurfaceGroup->getList().size());
-
- /// remove last surfaces from graphical group
- m_pSurfaceGroup->removeElement(&l1);
-
- /// make sure, list is empty
- EXPECT_EQ(0u, m_pSurfaceGroup->getList().size());
-}
-
-TEST_F(GraphicalGroupTest, DISABLED_getShader)
-{
- // TODO: how should this be tested?
- // each surface/layer may have a differnet shader.
- // what should be returned in that case?
-}
EXPECT_DOUBLE_EQ(expectedOpacity, pSurface2->getOpacity());
}
-TEST_F(SceneTest, createLayerGroup)
-{
- uint expectedId = 167;
- LayerGroup* pLayerGroup;
-
- /// make sure, expected layer group does not exist
- pLayerGroup = m_pScene->getLayerGroup(expectedId);
- ASSERT_FALSE(pLayerGroup);
-
- /// create expected layer group
- m_pScene->createLayerGroup(expectedId, 0);
-
- /// make sure, expected layer group does exist
- pLayerGroup = m_pScene->getLayerGroup(expectedId);
- EXPECT_TRUE(pLayerGroup);
-}
-
-TEST_F(SceneTest, createLayerGroup_twice)
-{
- uint expectedLayerGroupId = 169;
- uint expectedLayerId = 170;
- LayerGroup* pLayerGroup1;
- LayerGroup* pLayerGroup2;
- Layer layer(expectedLayerId);
-
- /// make sure, expected layer group does not exist
- pLayerGroup1 = m_pScene->getLayerGroup(expectedLayerGroupId);
- ASSERT_FALSE(pLayerGroup1);
-
- /// create expected layer group, get 1st handle to group
- pLayerGroup1 = m_pScene->createLayerGroup(expectedLayerGroupId, 0);
- ASSERT_TRUE(pLayerGroup1);
-
- /// make sure, expected layer group does exist
- EXPECT_TRUE(pLayerGroup1);
-
- /// create expected layer group again, get 2nd handle to group
- pLayerGroup2 = m_pScene->createLayerGroup(expectedLayerGroupId, 0);
-
- /// make sure, expected layer group does exist
- ASSERT_TRUE(pLayerGroup2);
-
- /// add layer to layer group using 1st handle
- pLayerGroup1->addElement(&layer);
-
- /// make sure, layer can be accessed in layer group using 2nd handle
- const LayerList& llist = pLayerGroup2->getList();
- EXPECT_EQ((uint)1, llist.size());
- LayerListConstIterator iter = llist.begin();
- EXPECT_EQ(expectedLayerId, (*iter)->getID());
- EXPECT_EQ(llist.end(), ++iter);
-}
-
-TEST_F(SceneTest, createSurfaceGroup)
-{
- uint expectedSurfaceGroupId = 172;
- SurfaceGroup* pSurfaceGroup;
-
- /// make sure, expected Surface group does not exist
- pSurfaceGroup = m_pScene->getSurfaceGroup(expectedSurfaceGroupId);
- ASSERT_FALSE(pSurfaceGroup);
-
- /// create expected Surface group, get 1st handle to group
- pSurfaceGroup = m_pScene->createSurfaceGroup(expectedSurfaceGroupId, 0);
- ASSERT_TRUE(pSurfaceGroup);
-
- /// make sure, expected Surface group does exist
- EXPECT_TRUE(pSurfaceGroup);
-
-}
-TEST_F(SceneTest, createSurfaceGroup_twice)
-{
- uint expectedSurfaceGroupId = 172;
- uint expectedSurfaceId = 173;
- SurfaceGroup* pSurfaceGroup1;
- SurfaceGroup* pSurfaceGroup2;
- Surface Surface(expectedSurfaceId);
-
- /// make sure, expected Surface group does not exist
- pSurfaceGroup1 = m_pScene->getSurfaceGroup(expectedSurfaceGroupId);
- ASSERT_FALSE(pSurfaceGroup1);
-
- /// create expected Surface group, get 1st handle to group
- pSurfaceGroup1 = m_pScene->createSurfaceGroup(expectedSurfaceGroupId, 0);
- ASSERT_TRUE(pSurfaceGroup1);
-
- /// make sure, expected Surface group does exist
- EXPECT_TRUE(pSurfaceGroup1);
-
- /// create expected Surface group again, get 2nd handle to group
- pSurfaceGroup2 = m_pScene->createSurfaceGroup(expectedSurfaceGroupId, 0);
-
- /// make sure, expected Surface group does exist
- ASSERT_TRUE(pSurfaceGroup2);
-
- /// add Surface to Surface group using 1st handle
- pSurfaceGroup1->addElement(&Surface);
-
- /// make sure, Surface can be accessed in Surface group using 2nd handle
- const SurfaceList& llist = pSurfaceGroup2->getList();
- EXPECT_EQ((uint)1, llist.size());
- SurfaceListConstIterator iter = llist.begin();
- EXPECT_EQ(expectedSurfaceId, (*iter)->getID());
- EXPECT_EQ(llist.end(), ++iter);
-}
-
TEST_F(SceneTest, removeLayer)
{
uint expectedLayerId = 188;
ASSERT_FALSE(m_pScene->getSurface(expectedSurfaceId));
}
-TEST_F(SceneTest, getSurfaceGroup)
-{
- uint expectedSurfaceGroupId = 198;
- SurfaceGroup* pSurfaceGroup;
-
- /// try to get non existing SurfaceGroup
- EXPECT_FALSE(m_pScene->getSurfaceGroup(expectedSurfaceGroupId));
-
- /// create SurfaceGroup
- pSurfaceGroup = m_pScene->createSurfaceGroup(expectedSurfaceGroupId, 0);
- ASSERT_TRUE(pSurfaceGroup);
-
- /// get SurfaceGroup
- ASSERT_EQ(pSurfaceGroup, m_pScene->getSurfaceGroup(expectedSurfaceGroupId));
-
- /// remove SurfaceGroup
- m_pScene->removeSurfaceGroup(pSurfaceGroup);
-
- /// try to get removed SurfaceGroup
- ASSERT_FALSE(m_pScene->getSurfaceGroup(expectedSurfaceGroupId));
-}
-
-TEST_F(SceneTest, getLayerGroup)
-{
- uint expectedLayerGroupId = 203;
- LayerGroup* pLayerGroup;
-
- /// try to get non existing LayerGroup
- EXPECT_FALSE(m_pScene->getLayerGroup(expectedLayerGroupId));
-
- /// create LayerGroup
- pLayerGroup = m_pScene->createLayerGroup(expectedLayerGroupId, 0);
- ASSERT_TRUE(pLayerGroup);
-
- /// get LayerGroup
- ASSERT_EQ(pLayerGroup, m_pScene->getLayerGroup(expectedLayerGroupId));
-
- /// remove LayerGroup
- m_pScene->removeLayerGroup(pLayerGroup);
-
- /// try to get removed LayerGroup
- ASSERT_FALSE(m_pScene->getLayerGroup(expectedLayerGroupId));
-}
-
TEST_F(SceneTest, getLayerIDs)
{
unsigned int layerId1 = 101;
EXPECT_EQ(surfaceId4, array[3]);
}
-TEST_F(SceneTest, getLayerGroupIDs)
-{
- unsigned int layergroupId1 = 201;
- unsigned int layergroupId2 = 202;
- unsigned int layergroupId3 = 203;
- unsigned int layergroupId4 = 204;
- unsigned int size;
- unsigned int* array;
-
- /// make sure, scene contains no layergroups
- m_pScene->getLayerGroupIDs(&size, &array);
- ASSERT_EQ((uint)0, size);
-
- /// create 4 layergroups in scene
- m_pScene->createLayerGroup(layergroupId1, 0);
- m_pScene->createLayerGroup(layergroupId2, 0);
- m_pScene->createLayerGroup(layergroupId3, 0);
- m_pScene->createLayerGroup(layergroupId4, 0);
-
- /// make sure, scene contains these 4 layergroups
- m_pScene->getLayerGroupIDs(&size, &array);
- ASSERT_EQ((uint)4, size);
- EXPECT_EQ(layergroupId1, array[0]);
- EXPECT_EQ(layergroupId2, array[1]);
- EXPECT_EQ(layergroupId3, array[2]);
- EXPECT_EQ(layergroupId4, array[3]);
-}
-
-TEST_F(SceneTest, getSurfaceGroupIDs)
-{
- unsigned int surfacegroupId1 = 201;
- unsigned int surfacegroupId2 = 202;
- unsigned int surfacegroupId3 = 203;
- unsigned int surfacegroupId4 = 204;
- unsigned int size;
- unsigned int* array;
-
- /// make sure, scene contains no surfacegroups
- m_pScene->getSurfaceGroupIDs(&size, &array);
- ASSERT_EQ((uint)0, size);
-
- /// create 4 surfacegroups in scene
- m_pScene->createSurfaceGroup(surfacegroupId1, 0);
- m_pScene->createSurfaceGroup(surfacegroupId2, 0);
- m_pScene->createSurfaceGroup(surfacegroupId3, 0);
- m_pScene->createSurfaceGroup(surfacegroupId4, 0);
-
- /// make sure, scene contains these 4 surfacegroups
- m_pScene->getSurfaceGroupIDs(&size, &array);
- ASSERT_EQ((uint)4, size);
- EXPECT_EQ(surfacegroupId1, array[0]);
- EXPECT_EQ(surfacegroupId2, array[1]);
- EXPECT_EQ(surfacegroupId3, array[2]);
- EXPECT_EQ(surfacegroupId4, array[3]);
-}
-
TEST_F(SceneTest, DISABLED_lockScene)
{
}
ASSERT_TRUE(&llist);
}
-TEST_F(SceneTest, removeSurfaceGroup)
-{
- uint expectedSurfaceGroupId = 172;
- SurfaceGroup* pSurfaceGroup;
-
- /// create expected Surface group
- pSurfaceGroup = m_pScene->createSurfaceGroup(expectedSurfaceGroupId, 0);
- ASSERT_TRUE(pSurfaceGroup);
-
- /// make sure, expected Surface group does exist
- pSurfaceGroup = m_pScene->getSurfaceGroup(expectedSurfaceGroupId);
- EXPECT_TRUE(pSurfaceGroup);
-
- /// remove surface group
- m_pScene->removeSurfaceGroup(pSurfaceGroup);
-
- /// make sure, expected Surface group does not exist
- pSurfaceGroup = m_pScene->getSurfaceGroup(expectedSurfaceGroupId);
- ASSERT_FALSE(pSurfaceGroup);
-}
-
-TEST_F(SceneTest, removeLayerGroup)
-{
- uint expectedLayerGroupId = 172;
- LayerGroup* pLayerGroup;
-
- /// create expected Layer group
- pLayerGroup = m_pScene->createLayerGroup(expectedLayerGroupId, 0);
- ASSERT_TRUE(pLayerGroup);
-
- /// make sure, expected Layer group does exist
- pLayerGroup = m_pScene->getLayerGroup(expectedLayerGroupId);
- EXPECT_TRUE(pLayerGroup);
-
- /// remove layer group
- m_pScene->removeLayerGroup(pLayerGroup);
-
- /// make sure, expected Layer group does not exist
- pLayerGroup = m_pScene->getLayerGroup(expectedLayerGroupId);
- ASSERT_FALSE(pLayerGroup);
-}
-
TEST_F(SceneTest, getAllSurfaces)
{
uint expectedId1 = 241;
ilmErrorTypes ilm_getSurfaceIDs(t_ilm_int* pLength,t_ilm_surface** ppArray);
/**
- * \brief Get all LayerGroupIds which are currently registered and managed by the services
- * \ingroup ilmControl
- * \param[out] pLength Pointer where array length of ids should be stored
- * \param[out] ppArray Array where the id should be stored,
- * the array will be allocated inside
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_getLayerGroupIDs(t_ilm_int* pLength,t_ilm_layergroup** ppArray);
-
-/**
- * \brief Get all SurfaceGroupIds which are currently registered and managed by the services
- * \ingroup ilmControl
- * \param[out] pLength Pointer where array length of ids should be stored
- * \param[out] ppArray Array where the id should be stored,
- * the array will be allocated inside
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_getSurfaceGroupIDs(t_ilm_int* pLength,t_ilm_surfacegroup** ppArray);
-
-/**
* \brief Get all SurfaceIds which are currently registered to a given layer and are managed by the services
* \ingroup ilmControl
* \param[in] layer Id of the Layer whose surfaces are to be returned
ilmErrorTypes ilm_layerTypeGetCapabilities(ilmLayerType layerType, t_ilm_layercapabilities *pCapabilities);
/**
- * \brief Create a layergroup
- * \ingroup ilmControl
- * \param[out] pLayergroup The id of the created layergroup is returned in this parameter
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layergroupCreate(t_ilm_layergroup *pLayergroup);
-
-/**
- * \brief Remove a layergroup
- * \ingroup ilmControl
- * \param[in] layergroup The layergroup to be removed
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layergroupRemove(t_ilm_layergroup layergroup);
-
-/**
- * \brief Add a layer to a layergroup
- * \ingroup ilmControl
- * \param[in] group The layergroup to add the layer
- * \param[in] layer The layer to add to the group
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layergroupAddLayer(t_ilm_layergroup group, t_ilm_layer layer);
-
-/**
- * \brief Remove a layer from a layergroup
- * \ingroup ilmControl
- * \param[in] layergroup The layergroup to remove the layer from
- * \param[in] layer The layer to be removed from the group
- *
- *
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layergroupRemoveLayer(t_ilm_layergroup layergroup, t_ilm_layer layer);
-
-/**
- * \brief Set the visibility of a layergroup. If a layergroup is not visible, the layers and their
- * surfaces will not be rendered.
- * \ingroup ilmControl
- * \param[in] layergroup Id of the layergroup to set the visibility of
- * \param[in] newVisibility ILM_SUCCESS sets layergroup visible, ILM_FALSE disables the visibility.
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layergroupSetVisibility(t_ilm_layergroup layergroup, t_ilm_bool newVisibility);
-
-/**
- * \brief Set the opacity of a layergroup.
- * \ingroup ilmControl
- * \param[in] group Id of the layergroup to set the opacity of.
- * \param[in] opacity 0.0 means the layergroup is fully transparent,
- * 1.0 means the layergroup is fully opaque
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layergroupSetOpacity(t_ilm_layergroup group, t_ilm_float opacity);
-
-/**
* \brief Create the logical surface, which has no native buffer associated
* \ingroup ilmControl
* \param[in] pSurfaceId The value pSurfaceId points to is used as ID for new surface;
ilmErrorTypes ilm_surfaceSetChromaKey(t_ilm_surface surfaceId, t_ilm_int* pColor);
/**
- * \brief Create a surfacegroup
- * \ingroup ilmControl
- * \param[in] pSurfacegroup The created surfacegroup is returned in this parameter
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_surfacegroupCreate(t_ilm_surfacegroup *pSurfacegroup);
-
-/**
-* \brief Remove a surfacegroup
- * \ingroup ilmControl
- * \param[in] surfacegroup The surfacegroup to be removed
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_surfacegroupRemove(t_ilm_surfacegroup surfacegroup);
-
-/**
- * \brief Add a surface to a surfacegroup
- * \ingroup ilmControl
- * \param[in] surfacegroup The surfacegroup to add the surface
- * \param[in] surface The surface to add to the group
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_surfacegroupAddSurface(t_ilm_surfacegroup surfacegroup, t_ilm_surface surface);
-
-/**
- * \brief Remove a surface from a surfacegroup
- * \ingroup ilmControl
- * \param[in] surfacegroup The surfacegroup to remove the surface from
- * \param[in] surface The surface to be removed from the group
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_surfacegroupRemoveSurface(t_ilm_surfacegroup surfacegroup, t_ilm_surface surface);
-
-/**
- * \brief Set the visibility of a surfacegroup. If a surfacegroup is not visible the contained
- * surfaces will not be rendered.
- * \ingroup ilmControl
- * \param[in] surfacegroup Id of the surfacegroup to set the visibility of
- * \param[in] newVisibility ILM_SUCCESS sets surfacegroup visible, ILM_FALSE disables the visibility.
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_surfacegroupSetVisibility(t_ilm_surfacegroup surfacegroup, t_ilm_bool newVisibility);
-
-/**
- * \brief Set the opacity of a surfacegroup.
- * \ingroup ilmControl
- * \param[in] surfacegroup Id of the surfacegroup to set the opacity of.
- * \param[in] opacity 0.0 means the surfacegroup is fully transparent,
- * 1.0 means the surfacegroup is fully opaque
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_surfacegroupSetOpacity(t_ilm_surfacegroup surfacegroup, t_ilm_float opacity);
-
-/**
* \brief Sets render order of layers on a display
* \ingroup ilmControl
* \param[in] display Id of display to set the given order of layers.
typedef enum e_ilmObjectType
{
ILM_SURFACE = 0, /*!< Surface Object Type */
- ILM_LAYER = 1, /*!< Layer Object Type */
- ILM_SURFACEGROUP = 2, /*!< SurfaceGroup Object Type */
- ILM_LAYERGROUP = 3 /*!< LayerGroup Object Type */
+ ILM_LAYER = 1 /*!< Layer Object Type */
} ilmObjectType;
/**
typedef t_ilm_uint t_ilm_surface;
/**
- * \brief Typedef for representing a layergroup
- * \ingroup ilmControl
- **/
-typedef t_ilm_uint t_ilm_layergroup;
-
-/**
- * \brief Typedef for representing a surfacegroup
- * \ingroup ilmControl
- **/
-typedef t_ilm_uint t_ilm_surfacegroup;
-
-/**
* \brief Typedef for representing a display number
* \ingroup ilmClient
**/
return returnValue;
}
-ilmErrorTypes ilm_getLayerGroupIDs(t_ilm_int* pLength, t_ilm_layergroup** ppArray)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("ListAllLayerGroupIDS");
- if (pLength && ppArray
- && command
- && sendAndWaitForResponse(command, &response, gResponseTimeout)
- && gIpcModule.getUintArray(response, ppArray, pLength))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_getSurfaceGroupIDs(t_ilm_int* pLength, t_ilm_surfacegroup** ppArray)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("ListAllSurfaceGroupIDS");
- if (pLength && ppArray
- && command
- && sendAndWaitForResponse(command, &response, gResponseTimeout)
- && gIpcModule.getUintArray(response, ppArray, pLength))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
ilmErrorTypes ilm_getSurfaceIDsOnLayer(t_ilm_layer layer, t_ilm_int* pLength, t_ilm_surface** ppArray)
{
ilmErrorTypes returnValue = ILM_FAILED;
return returnValue;
}
-ilmErrorTypes ilm_layergroupCreate(t_ilm_layergroup *pLayergroup)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- if (pLayergroup && (INVALID_ID != *pLayergroup))
- {
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("CreateLayerGroupFromId");
- if (pLayergroup
- && command
- && gIpcModule.appendUint(command, *pLayergroup)
- && sendAndWaitForResponse(command, &response, gResponseTimeout)
- && gIpcModule.getUint(response, pLayergroup))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- }
- else
- {
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("CreateLayerGroup");
- if (pLayergroup
- && command
- && sendAndWaitForResponse(command, &response, gResponseTimeout)
- && gIpcModule.getUint(response, pLayergroup))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- }
- return returnValue;
-}
-
-ilmErrorTypes ilm_layergroupRemove(t_ilm_layergroup group)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("RemoveLayerGroup");
- if (command
- && gIpcModule.appendUint(command, group)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_layergroupAddLayer(t_ilm_layergroup group, t_ilm_layer layer)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("AddLayerToLayerGroup");
- if (command
- && gIpcModule.appendUint(command, layer)
- && gIpcModule.appendUint(command, group)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_layergroupRemoveLayer(t_ilm_layergroup group, t_ilm_layer layer)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("RemoveLayerFromLayerGroup");
- if (command
- && gIpcModule.appendUint(command, layer)
- && gIpcModule.appendUint(command, group)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_layergroupSetVisibility(t_ilm_layergroup group, t_ilm_bool newVisibility)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("SetLayergroupVisibility");
- if (command
- && gIpcModule.appendUint(command, group)
- && gIpcModule.appendBool(command, newVisibility)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_layergroupSetOpacity(t_ilm_layergroup group, t_ilm_float opacity)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("SetLayergroupOpacity");
- if (command
- && gIpcModule.appendUint(command, group)
- && gIpcModule.appendDouble(command, opacity)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
ilmErrorTypes ilm_surfaceCreate(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, t_ilm_surface* pSurfaceId)
{
ilmErrorTypes returnValue = ILM_FAILED;
return returnValue;
}
-ilmErrorTypes ilm_surfacegroupCreate(t_ilm_surfacegroup *pSurfacegroup)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- if (pSurfacegroup && (INVALID_ID != *pSurfacegroup))
- {
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("CreateSurfaceGroupFromId");
- if (command
- && gIpcModule.appendUint(command, *pSurfacegroup)
- && sendAndWaitForResponse(command, &response, gResponseTimeout)
- && gIpcModule.getUint(response, pSurfacegroup))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- }
- else
- {
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("CreateSurfaceGroup");
- if (pSurfacegroup
- && command
- && sendAndWaitForResponse(command, &response, gResponseTimeout)
- && gIpcModule.getUint(response, pSurfacegroup))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- }
- return returnValue;
-}
-
-ilmErrorTypes ilm_surfacegroupRemove(t_ilm_surfacegroup group)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("RemoveSurfaceGroup");
- if (command
- && gIpcModule.appendUint(command, group)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_surfacegroupAddSurface(t_ilm_surfacegroup group, t_ilm_surface surface)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("AddSurfaceToSurfaceGroup");
- if (command
- && gIpcModule.appendUint(command, surface)
- && gIpcModule.appendUint(command, group)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_surfacegroupRemoveSurface(t_ilm_surfacegroup group, t_ilm_surface surface)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("RemoveSurfaceFromSurfaceGroup");
- if (command
- && gIpcModule.appendUint(command, surface)
- && gIpcModule.appendUint(command, group)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_surfacegroupSetVisibility(t_ilm_surfacegroup group, t_ilm_bool newVisibility)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("SetSurfacegroupVisibility");
- if (command
- && gIpcModule.appendUint(command, group)
- && gIpcModule.appendBool(command, newVisibility)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
-ilmErrorTypes ilm_surfacegroupSetOpacity(t_ilm_surfacegroup group, t_ilm_float opacity)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("SetSurfacegroupOpacity");
- if (command
- && gIpcModule.appendUint(command, group)
- && gIpcModule.appendDouble(command, opacity)
- && sendAndWaitForResponse(command, &response, gResponseTimeout))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- return returnValue;
-}
-
ilmErrorTypes ilm_displaySetRenderOrder(t_ilm_display display, t_ilm_layer *pLayerId, const t_ilm_uint number)
{
ilmErrorTypes returnValue = ILM_FAILED;
ilm_surfaceRemove(surfaces[i]);
};
- t_ilm_layergroup* layergroups = NULL;
- t_ilm_int numLayergroup=0;
- ilm_getLayerGroupIDs(&numLayergroup, &layergroups);
- for (t_ilm_int i=0; i<numLayergroup; i++ ){
- ilm_layergroupRemove(layergroups[i]);
- };
-
- t_ilm_surfacegroup* surfacegroups = NULL;
- t_ilm_int numSurfacegroup=0;
- ilm_getSurfaceGroupIDs(&numSurfacegroup, &surfacegroups);
- for (t_ilm_int i=0; i<numSurfacegroup; i++ ){
- ilm_surfacegroupRemove(surfacegroups[i]);
- };
ilm_commitChanges();
}
ASSERT_DOUBLE_EQ(0.001, opacity);
}
-TEST_F(IlmCommandTest, SetGetLayerGroupOpacity) {
- uint layer1 = 36;
- uint layer2 = 44;
- uint group = 99;
- t_ilm_float opacity;
-
- ilm_layerCreate(&layer1);
- ilm_layerCreate(&layer2);
- ilm_layergroupCreate(&group);
- ilm_layergroupAddLayer(group, layer1);
- ilm_layergroupAddLayer(group, layer2);
- ilm_commitChanges();
-
- ilm_layergroupSetOpacity(group,0.88);
- ilm_commitChanges();
- ilm_layerGetOpacity(layer1,&opacity);
- ASSERT_DOUBLE_EQ(0.88, opacity);
- ilm_layerGetOpacity(layer2,&opacity);
- ASSERT_DOUBLE_EQ(0.88, opacity);
-
- ilm_layergroupSetOpacity(group,0.001);
- ilm_commitChanges();
- ilm_layerGetOpacity(layer1,&opacity);
- ASSERT_DOUBLE_EQ(0.001, opacity);
- ilm_layerGetOpacity(layer2,&opacity);
- ASSERT_DOUBLE_EQ(0.001, opacity);
-}
-
-TEST_F(IlmCommandTest, SetGetSurfaceGroupOpacity) {
- uint surface1 = 36;
- uint surface2 = 44;
- uint group = 99;
- t_ilm_float opacity;
-
- ilm_surfaceCreate(0,0,0,ILM_PIXELFORMAT_RGBA_8888,&surface1);
- ilm_surfaceCreate(0,0,0,ILM_PIXELFORMAT_RGBA_8888,&surface2);
- ilm_surfacegroupCreate(&group);
-
- ilm_surfacegroupAddSurface(group,surface1);
- ilm_surfacegroupAddSurface(group,surface2);
-
- ilm_surfacegroupSetOpacity(group,0.88);
- ilm_commitChanges();
- ilm_surfaceGetOpacity(surface1,&opacity);
- ASSERT_DOUBLE_EQ(0.88, opacity);
- ilm_surfaceGetOpacity(surface2,&opacity);
- ASSERT_DOUBLE_EQ(0.88, opacity);
-
- ilm_surfacegroupSetOpacity(group,0.001);
- ilm_commitChanges();
- ilm_surfaceGetOpacity(surface1,&opacity);
- ASSERT_DOUBLE_EQ(0.001, opacity);
- ilm_surfaceGetOpacity(surface2,&opacity);
- ASSERT_DOUBLE_EQ(0.001, opacity);
-}
-
TEST_F(IlmCommandTest, SetGetSurfaceVisibility) {
uint surface1 = 36;
t_ilm_bool visibility;
ASSERT_EQ(ILM_TRUE, visibility);
}
-TEST_F(IlmCommandTest, SetGetLayerGroupVisibility) {
- uint layer1 = 36;
- uint layer2 = 44;
- uint group = 99;
- t_ilm_bool visibility;
-
- ilm_layerCreate(&layer1);
- ilm_layerCreate(&layer2);
- printf("layers: %i %i", layer1, layer2);
- ilm_layergroupCreate(&group);
- ilm_layergroupAddLayer(group,layer1);
- ilm_layergroupAddLayer(group,layer2);
- ilm_commitChanges();
-
- ilm_layergroupSetVisibility(group,ILM_TRUE);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
-
- ilm_layergroupSetVisibility(group,ILM_FALSE);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_EQ(ILM_FALSE, visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_EQ(ILM_FALSE, visibility);
-
- ilm_layergroupSetVisibility(group,ILM_TRUE);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
-}
-
-TEST_F(IlmCommandTest, SetGetSurfaceGroupVisibility) {
- uint surface1 = 36;
- uint surface2 = 44;
- uint group = 99;
- t_ilm_bool visibility;
-
- ilm_surfaceCreate(0,0,0,ILM_PIXELFORMAT_RGBA_8888,&surface1);
- ilm_surfaceCreate(0,0,0,ILM_PIXELFORMAT_RGBA_8888,&surface2);
- ilm_surfacegroupCreate(&group);
- ilm_surfacegroupAddSurface(group,surface1);
- ilm_surfacegroupAddSurface(group,surface2);
-
- ilm_surfacegroupSetVisibility(group,ILM_TRUE);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
-
- ilm_surfacegroupSetVisibility(group,ILM_FALSE);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_EQ(ILM_FALSE, visibility);
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_EQ(ILM_FALSE, visibility);
-
- ilm_surfacegroupSetVisibility(group,ILM_TRUE);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_EQ(ILM_TRUE, visibility);
-
-}
TEST_F(IlmCommandTest, ilm_getScreenIDs) {
t_ilm_uint numberOfScreens = 0;
t_ilm_uint* screenIDs = NULL;
ASSERT_EQ(surface2,IDs[1]);
}
-TEST_F(IlmCommandTest, ilm_getSurfaceGroupIDs) {
- uint surfacegroup1 = 3246;
- uint surfacegroup2 = 46586;
-
- ilm_surfacegroupCreate(&surfacegroup1);
- ilm_surfacegroupCreate(&surfacegroup2);
- ilm_commitChanges();
-
- t_ilm_int length;
- t_ilm_uint* IDs;
- ilm_getSurfaceGroupIDs(&length,&IDs);
-
- ASSERT_EQ(surfacegroup1,IDs[0]);
- ASSERT_EQ(surfacegroup2,IDs[1]);
-}
-
-TEST_F(IlmCommandTest, ilm_getLayerGroupIDs) {
- uint layergroup1 = 3246;
- uint layergroup2 = 46586;
-
- ilm_layergroupCreate(&layergroup1);
- ilm_layergroupCreate(&layergroup2);
- ilm_commitChanges();
-
- t_ilm_int length;
- t_ilm_uint* IDs;
- ilm_getLayerGroupIDs(&length,&IDs);
-
- ASSERT_EQ(layergroup1,IDs[0]);
- ASSERT_EQ(layergroup2,IDs[1]);
-}
-
TEST_F(IlmCommandTest, ilm_surfaceCreate_Remove) {
uint surface1 = 3246;
uint surface2 = 46586;
ASSERT_EQ(ILM_PIXELFORMAT_R_8,p7);
}
-TEST_F(IlmCommandTest, ilm_surfacegroupCreate_ilm_surfacegroupRemove_ilm_surfacegroupAddSurface_ilm_surfacegroupRemoveSurface) {
- uint surface1 = 36;
- uint surface2 = 44;
- uint group = 99;
- t_ilm_bool visibility;
-
- ilm_surfaceCreate(0,0,0,ILM_PIXELFORMAT_RGBA_8888,&surface1);
- ilm_surfaceCreate(0,0,0,ILM_PIXELFORMAT_RGBA_8888,&surface2);
- ilm_surfacegroupCreate(&group);
- ilm_surfaceSetVisibility(surface1,true);
- ilm_surfaceSetVisibility(surface2,true);
- ilm_commitChanges();
-
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_TRUE(visibility);
- ilm_surfaceGetVisibility(surface2,&visibility);
- ASSERT_TRUE(visibility);
-
- ilm_surfacegroupSetVisibility(group,false);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_TRUE(visibility);
- ilm_surfaceGetVisibility(surface2,&visibility);
- ASSERT_TRUE(visibility);
-
- ilm_surfacegroupAddSurface(group,surface1);
- ilm_surfacegroupSetVisibility(group,false);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_FALSE(visibility);
- ilm_surfaceGetVisibility(surface2,&visibility);
- ASSERT_TRUE(visibility);
-
- ilm_surfacegroupAddSurface(group,surface2);
- ilm_surfacegroupSetVisibility(group,false);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_FALSE(visibility);
- ilm_surfaceGetVisibility(surface2,&visibility);
- ASSERT_FALSE(visibility);
-
- ilm_surfacegroupRemoveSurface(group,surface2);
- ilm_surfacegroupSetVisibility(group,true);
- ilm_commitChanges();
- ilm_surfaceGetVisibility(surface1,&visibility);
- ASSERT_TRUE(visibility);
- ilm_surfaceGetVisibility(surface2,&visibility);
- ASSERT_FALSE(visibility);
-
- t_ilm_int length;
- t_ilm_uint* IDs;
- ilm_getSurfaceGroupIDs(&length,&IDs);
- ASSERT_EQ(length,1);
- ASSERT_EQ(group,IDs[0]);
-
- ilm_surfacegroupRemove(group);
- ilm_commitChanges();
- ilm_getSurfaceGroupIDs(&length,&IDs);
- ASSERT_EQ(length,0);
-
-}
-
-TEST_F(IlmCommandTest, ilm_layergroupCreate_ilm_layergroupRemove_ilm_layergroupAddlayer_ilm_layergroupRemovelayer) {
- uint layer1 = 36;
- uint layer2 = 44;
- uint group = 99;
- t_ilm_bool visibility;
-
- ilm_layerCreate(&layer1);
- ilm_layerCreate(&layer2);
- ilm_layergroupCreate(&group);
- ilm_layerSetVisibility(layer1,true);
- ilm_layerSetVisibility(layer2,true);
- ilm_commitChanges();
-
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_TRUE(visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_TRUE(visibility);
-
- ilm_layergroupSetVisibility(group,false);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_TRUE(visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_TRUE(visibility);
-
- ilm_layergroupAddLayer(group,layer1);
- ilm_layergroupSetVisibility(group,false);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_FALSE(visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_TRUE(visibility);
-
- ilm_layergroupAddLayer(group,layer2);
- ilm_layergroupSetVisibility(group,false);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_FALSE(visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_FALSE(visibility);
-
- ilm_layergroupRemoveLayer(group,layer2);
- ilm_layergroupSetVisibility(group,true);
- ilm_commitChanges();
- ilm_layerGetVisibility(layer1,&visibility);
- ASSERT_TRUE(visibility);
- ilm_layerGetVisibility(layer2,&visibility);
- ASSERT_FALSE(visibility);
-
- t_ilm_int length;
- t_ilm_uint* IDs;
- ilm_getLayerGroupIDs(&length,&IDs);
- ASSERT_EQ(length,1);
- ASSERT_EQ(group,IDs[0]);
-
- ilm_layergroupRemove(group);
- ilm_commitChanges();
- ilm_getLayerGroupIDs(&length,&IDs);
- ASSERT_EQ(length,0);
-
-}
-
TEST_F(IlmCommandTest, ilm_keyboard_focus)
{
uint surface;
+++ /dev/null
-/***************************************************************************
-*
-* 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 _LAYERGROUPADDLAYERCOMMAND_H_
-#define _LAYERGROUPADDLAYERCOMMAND_H_
-
-#include "ICommand.h"
-
-class LayergroupAddLayerCommand : public ICommand
-{
-public:
- /*!
- * \action This command adds a layer to a layer group within the GENIVI LayerManagement
- * \frequency Called within initialisations in order to change properties of all group
- * members at once at a later point in time, not needed for every layer.
- * \param[in] sender process id of application that sent this command
- * \param[in] layergroupid id of layer group
- * \param[in] layerid id of layer
- * \ingroup Commands
- */
- LayergroupAddLayerCommand(pid_t sender, unsigned int layergroupid, unsigned int layerid)
- : ICommand(ExecuteAsynchronous, sender)
- , m_layergroupid(layergroupid)
- , m_layerid(layerid)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~LayergroupAddLayerCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned m_layergroupid;
- const unsigned m_layerid;
-
- // for unit testing
- template <typename layerid_type, typename layergroupid_type> friend class LayergroupAddLayerCommandEqMatcherP2;
-};
-
-
-#endif /* _LAYERGROUPADDLAYERCOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _LAYERGROUPCREATECOMMAND_H_
-#define _LAYERGROUPCREATECOMMAND_H_
-
-#include "ICommand.h"
-#include "IScene.h"
-
-class LayergroupCreateCommand : public ICommand
-{
-public:
- /*!
- * \action This command creates a layer group within the GENIVI LayerManagement
- * \frequency Called within initializations in order to change properties of all
- * group members at once at a later point in time.
- * \param[in] sender process id of application that sent this command
- * \param[in] idReturn location to store layer group id on execution;
- * pre-initialized value will be interpreted as id request
- * \ingroup Commands
- */
- LayergroupCreateCommand(pid_t sender, uint* idReturn)
- : ICommand(ExecuteSynchronous, sender)
- , m_idReturn(idReturn)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~LayergroupCreateCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- uint* m_idReturn;
-};
-
-
-#endif /* _CREATECOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _LAYERGROUPREMOVECOMMAND_H_
-#define _LAYERGROUPREMOVECOMMAND_H_
-
-#include "ICommand.h"
-
-class LayergroupRemoveCommand : public ICommand
-{
-public:
- /*!
- * \action This command removes a layer group within the GENIVI LayerManagement
- * \frequency Infrequent.
- * \param[in] sender process id of application that sent this command
- * \param[in] objectID id of layer group
- * \ingroup Commands
- */
- LayergroupRemoveCommand(pid_t sender, unsigned int objectID)
- : ICommand(ExecuteSynchronous, sender)
- , m_idToRemove(objectID)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~LayergroupRemoveCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_idToRemove;
-
- // for unit testing
- template<typename idToRemove_type> friend class LayergroupRemoveCommandEqMatcherP;
-};
-
-#endif /* _LAYERGROUPREMOVECOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _LAYERGROUPREMOVELAYERCOMMAND_H_
-#define _LAYERGROUPREMOVELAYERCOMMAND_H_
-
-#include "ICommand.h"
-
-class LayergroupRemoveLayerCommand : public ICommand
-{
-public:
- /*!
- * \action This command removes a layer from a layer group within the GENIVI LayerManagement
- * \frequency Infrequent.
- * \param[in] sender process id of application that sent this command
- * \param[in] layergroupid id of layer group
- * \param[in] layerid id lf layer
- * \ingroup Commands
- */
- LayergroupRemoveLayerCommand(pid_t sender, unsigned int layergroupid, unsigned int layerid)
- : ICommand(ExecuteSynchronous, sender)
- , m_layergroupid(layergroupid)
- , m_layerid(layerid)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~LayergroupRemoveLayerCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned m_layergroupid;
- const unsigned m_layerid;
-
- // for unit testing
- template <typename layerid_type, typename layergroupid_type> friend class LayergroupRemoveLayerCommandEqMatcherP2;
-};
-
-#endif /* _LAYERGROUPREMOVELAYERCOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _LAYERGROUPSETOPACITYCOMMAND_H_
-#define _LAYERGROUPSETOPACITYCOMMAND_H_
-
-#include "ICommand.h"
-
-class LayergroupSetOpacityCommand : public ICommand
-{
-public:
- /*!
- * \action This command sets the opacity of a layer group within the GENIVI LayerManagement
- * \frequency Called in order to rearrange graphical output.
- * \param[in] sender process id of application that sent this command
- * \param[in] id id of layer group
- * \param[in] Opacity new opacity for all layers in layer group
- * \ingroup Commands
- */
- LayergroupSetOpacityCommand(pid_t sender, unsigned int id, double Opacity)
- : ICommand(ExecuteAsynchronous, sender)
- , m_id(id)
- , m_opacity(Opacity)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~LayergroupSetOpacityCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_id;
- const double m_opacity;
-
- // for unit testing
- template <typename id_type, typename Opacity_type> friend class LayergroupSetOpacityCommandEqMatcherP2;
-};
-
-
-#endif /* _LAYERGROUPSETOPACITYCOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _LAYERGROUPSETVISIBILITYCOMMAND_H_
-#define _LAYERGROUPSETVISIBILITYCOMMAND_H_
-
-#include "ICommand.h"
-
-class LayergroupSetVisibilityCommand : public ICommand
-{
-public:
- /*!
- * \action This command sets the visibility of a layer group within the GENIVI LayerManagement
- * \frequency Called in order to rearrange graphical output.
- * \param[in] sender process id of application that sent this command
- * \param[in] givenid if of layer group
- * \param[in] newvisibility TRUE: set all layers of layer group to visible,
- * FALSE: set all layers of layer group to invisible
- * \ingroup Commands
- */
- LayergroupSetVisibilityCommand(pid_t sender, const unsigned int givenid, bool newvisibility)
- : ICommand(ExecuteAsynchronous, sender)
- , m_idtoSet(givenid)
- , m_visibility(newvisibility)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~LayergroupSetVisibilityCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_idtoSet;
- const bool m_visibility;
-
- // for unit testing
- template <typename id_type, typename visibility_type> friend class LayergroupSetVisibilityCommandEqMatcherP2;
-};
-
-
-#endif /* _LAYERGROUPSETVISIBILITYCOMMAND_H_ */
unsigned int getShaderID() const;
private:
- /// detach shader from all surfaces, surface groups, etc... from surfaces
+ /// detach shader from all surfaces
bool removeShaderFromAllSurfaces(const SurfaceMap & surfaceMap, Shader* shader);
bool removeShaderFromAllLayers(const LayerMap & layerMap, Shader *& shader);
+++ /dev/null
-/***************************************************************************
-*
-* 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 _SURFACEGROUPADDSURFACECOMMAND_H_
-#define _SURFACEGROUPADDSURFACECOMMAND_H_
-
-#include "ICommand.h"
-
-class SurfacegroupAddSurfaceCommand : public ICommand
-{
-public:
- /*!
- * \action This command adds a surface to a surface group within the
- * GENIVI LayerManagement
- * \frequency Called within initializations in order to change properties of
- * all group members at once at a later point in time, not needed
- * for every surface.
- * \param[in] sender process id of application that sent this command
- * \param[in] surfacegroupid id of surface group
- * \param[in] surfaceid id of surface
- * \ingroup Commands
- */
- SurfacegroupAddSurfaceCommand(pid_t sender, unsigned int surfacegroupid, unsigned int surfaceid)
- : ICommand(ExecuteAsynchronous, sender)
- , m_surfacegroupid(surfacegroupid)
- , m_surfaceid(surfaceid)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~SurfacegroupAddSurfaceCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_surfacegroupid;
- const unsigned int m_surfaceid;
-
- // for unit testing
- template <typename surfaceid_type, typename surfacegroupid_type> friend class SurfacegroupAddSurfaceCommandEqMatcherP2;
-};
-
-#endif /* _SURFACEGROUPADDSURFACECOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _SURFACEGROUPCREATECOMMAND_H_
-#define _SURFACEGROUPCREATECOMMAND_H_
-
-#include "ICommand.h"
-#include "IScene.h"
-
-class SurfacegroupCreateCommand : public ICommand
-{
-public:
- /*!
- * \action This command creates a surface group within the
- * GENIVI LayerManagement
- * \frequency Used for management of several surfaces, only called
- * in initialization phase.
- * \param[in] sender process id of application that sent this command
- * \param[in] idReturn location to store id for new surface group on execution
- * pre-initialized values is interpreted as requested id for new surface group
- * \ingroup Commands
- */
- SurfacegroupCreateCommand(pid_t sender, uint* idReturn)
- : ICommand(ExecuteSynchronous, sender)
- , m_idReturn(idReturn)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~SurfacegroupCreateCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- uint* m_idReturn;
-};
-
-
-#endif /* _SURFACEGROUPCREATECOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _SURFACEGROUPREMOVECOMMAND_H_
-#define _SURFACEGROUPREMOVECOMMAND_H_
-
-#include "ICommand.h"
-
-class SurfacegroupRemoveCommand : public ICommand
-{
-public:
- /*!
- * \action This command removes a surface group within the GENIVI
- * LayerManagement
- * \frequency Called during removal of applications with several surfaces
- * or even application groups combined of several surfaces.
- * \param[in] sender process id of application that sent this command
- * \param[in] objectID id of surface group
- * \ingroup Commands
- */
- SurfacegroupRemoveCommand(pid_t sender, unsigned int objectID)
- : ICommand(ExecuteSynchronous, sender)
- , m_idToRemove(objectID)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~SurfacegroupRemoveCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_idToRemove;
-
- // for unit testing
- template<typename idToRemove_type> friend class SurfacegroupRemoveCommandEqMatcherP;
-};
-
-#endif /* _SURFACEGROUPREMOVECOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _SURFACEGROUPREMOVESURFACECOMMAND_H_
-#define _SURFACEGROUPREMOVESURFACECOMMAND_H_
-
-#include "ICommand.h"
-
-class SurfacegroupRemoveSurfaceCommand : public ICommand
-{
-public:
- /*!
- * \action This command removes a surface from a surface group within the GENIVI LayerManagement
- * \frequency Used for surface group management.
- * \param[in] sender process id of application that sent this command
- * \param[in] surfacegroupid id of surface group
- * \param[in] surfaceid id of surface
- * \ingroup Commands
- */
- SurfacegroupRemoveSurfaceCommand(pid_t sender, int surfacegroupid, unsigned int surfaceid)
- : ICommand(ExecuteAsynchronous, sender)
- , m_surfacegroupid(surfacegroupid)
- , m_surfaceid(surfaceid)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~SurfacegroupRemoveSurfaceCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_surfacegroupid;
- const unsigned int m_surfaceid;
-};
-
-#endif /* _SURFACEGROUPREMOVESURFACECOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _SURFACEGROUPSETOPACITYCOMMAND_H_
-#define _SURFACEGROUPSETOPACITYCOMMAND_H_
-
-#include "ICommand.h"
-
-class SurfacegroupSetOpacityCommand : public ICommand
-{
-public:
- /*!
- * \action This command sets the opacity of a surface group within the GENIVI LayerManagement
- * \frequency Used for surface group management.
- * \param[in] sender process id of application that sent this command
- * \param[in] id id of surface group
- * \param[in] Opacity new opacity for all surfaces in group
- * \ingroup Commands
- */
- SurfacegroupSetOpacityCommand(pid_t sender, unsigned int id, double Opacity)
- : ICommand(ExecuteAsynchronous, sender)
- , m_id(id)
- , m_opacity(Opacity)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~SurfacegroupSetOpacityCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_id;
- const double m_opacity;
-
- // for unit testing
- template <typename id_type, typename Opacity_type> friend class SurfacegroupSetOpacityCommandEqMatcherP2;
-};
-
-
-#endif /* _SURFACEGROUPSETOPACITYCOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 _SURFACEGROUPSETVISIBILITYCOMMAND_H_
-#define _SURFACEGROUPSETVISIBILITYCOMMAND_H_
-
-#include "ICommand.h"
-
-class SurfacegroupSetVisibilityCommand : public ICommand
-{
-public:
- /*!
- * \action This command sets the visibility of a surface group within the GENIVI LayerManagement
- * \frequency Used for surface group management.
- * \param[in] sender process id of application that sent this command
- * \param[in] givenid id ofsurface group
- * \param[in] newvisibility TRUE: all surfaces in group visible, FALSE: all surface in group invisible
- * \ingroup Commands
- */
- SurfacegroupSetVisibilityCommand(pid_t sender, const unsigned int givenid, bool newvisibility)
- : ICommand(ExecuteAsynchronous, sender)
- , m_idtoSet(givenid)
- , m_visibility(newvisibility)
- {}
-
- /**
- * \brief default destructor
- */
- virtual ~SurfacegroupSetVisibilityCommand() {}
-
- /**
- * \brief Execute this command.
- * \param[in] executor Pointer to instance executing the LayerManagement COmmands
- * \return ExecutionSuccess: execution successful
- * \return ExecutionSuccessRedraw: execution successful and screen needs to be redrawn
- * \return ExecutionFailed: execution failed
- * \return ExecutionFailedRedraw: execution unsuccessful and screen needs to be redrawn
- */
- virtual ExecutionResult execute(ICommandExecutor* executor);
-
- /**
- * \brief Get description string for this command.
- * \return String object with description of this command object
- */
- virtual const std::string getString();
-
-private:
- const unsigned int m_idtoSet;
- const bool m_visibility;
-
- // for unit testing
- template <typename id_type, typename visibility_type> friend class SurfacegroupSetVisibilityCommandEqMatcherP2;
-};
-
-
-#endif /* _SURFACEGROUPSETVISIBILITYCOMMAND_H_ */
+++ /dev/null
-/***************************************************************************
-*
-* 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 "LayergroupAddLayerCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-#include <algorithm>
-
-ExecutionResult LayergroupAddLayerCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- LayerGroup* lg = scene.getLayerGroup(m_layergroupid);
- Layer* layer = scene.getLayer(m_layerid);
-
- if (lg && layer)
- {
- // check if already a member of the group
- const LayerList list = lg->getList();
-
- LayerListConstIterator iter = std::find(list.begin(), list.end(), layer);
- LayerListConstIterator iterEnd = list.end();
-
- if (iter != iterEnd)
- {
- LOG_ERROR("LayergroupAddLayerCommand","layer is already a member of the group");
- return ExecutionFailed; // already is member of the group
- }
-
- lg->addElement(layer);
- LOG_DEBUG("LayergroupAddLayerCommand","adding layer " << m_layerid << " to group " << m_layergroupid);
- LOG_DEBUG("LayergroupAddLayerCommand","now there are " << lg->getList().size() << " elements");
- }
- else
- {
- if (!lg)
- {
- LOG_DEBUG("LayergroupAddLayerCommand","Layergroup with id " << m_layergroupid << " not found.");
- return ExecutionFailed;
- }
- if (!layer)
- {
- LOG_DEBUG("LayergroupAddLayerCommand","Layer with id " << m_layerid << " not found.");
- return ExecutionFailed;
- }
- }
- return ExecutionSuccess;
-}
-
-const std::string LayergroupAddLayerCommand::getString()
-{
- std::stringstream description;
- description << "LayergroupAddLayerCommand("
- << "layergroupid=" << m_layergroupid
- << ", layerid=" << m_layerid
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "LayergroupCreateCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult LayergroupCreateCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
- ExecutionResult result = ExecutionFailed;
-
- LayerGroup *layergroup = scene.createLayerGroup(*m_idReturn, getSenderPid());
-
- if (layergroup)
- {
- *m_idReturn = layergroup->getID();
-
- LOG_DEBUG("CreateCommand", "created layergroup with id: " << layergroup->getID());
- result = ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string LayergroupCreateCommand::getString()
-{
- std::stringstream description;
- description << "LayergroupCreateCommand("
- << "idReturn=" << m_idReturn << "=" << *m_idReturn
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "LayergroupRemoveCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-#include <sstream>
-
-ExecutionResult LayergroupRemoveCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- LayerGroup* layergroup = scene.getLayerGroup(m_idToRemove);
- if (layergroup)
- {
- scene.removeLayerGroup(layergroup);
- result = ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string LayergroupRemoveCommand::getString()
-{
- std::stringstream description;
- description << "LayergroupRemoveCommand("
- << "idToRemove=" << m_idToRemove
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "LayergroupRemoveLayerCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult LayergroupRemoveLayerCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- LayerGroup* lg = scene.getLayerGroup(m_layergroupid);
- Layer* layer = scene.getLayer(m_layerid);
-
- if (lg && layer)
- {
- lg->removeElement(layer);
- result = ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string LayergroupRemoveLayerCommand::getString()
-{
- std::stringstream description;
- description << "LayergroupRemoveLayerCommand("
- << "layergroupid=" << m_layergroupid
- << ", layerid=" << m_layerid
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "LayergroupSetOpacityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult LayergroupSetOpacityCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- LayerGroup* layergroup = scene.getLayerGroup(m_id);
-
- if (layergroup)
- {
- LOG_DEBUG("LayergroupSetOpacityCommand","new opacity " << m_opacity << " for id: " << m_id);
- result = layergroup->setOpacity(m_opacity) ? ExecutionSuccessRedraw : ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string LayergroupSetOpacityCommand::getString()
-{
- std::stringstream description;
- description << "LayergroupSetOpacityCommand("
- << "id=" << m_id
- << ", opacity=" << m_opacity
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "LayergroupSetVisibilityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult LayergroupSetVisibilityCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- LayerGroup* layergroup = scene.getLayerGroup(m_idtoSet);
-
- if (layergroup)
- {
- LOG_DEBUG("LayergroupSetVisibilityCommand", "setting visibility: " << m_visibility << " of id " << m_idtoSet);
- result = layergroup->setVisibility(m_visibility) ? ExecutionSuccessRedraw : ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string LayergroupSetVisibilityCommand::getString()
-{
- std::stringstream description;
- description << "LayergroupSetVisibilityCommand("
- << "idtoSet=" << m_idtoSet
- << ", visibility=" << m_visibility
- << ")";
- return description.str();
-}
return result;
}
-/// detach shader from all surfaces, surface groups, etc... from surfaces
+/// detach shader from all surfaces
bool ShaderDestroyCommand::removeShaderFromAllSurfaces(const SurfaceMap & surfaceMap, Shader* shader)
{
bool result = false;
+++ /dev/null
-/***************************************************************************
-*
-* 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 "SurfacegroupAddSurfaceCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "SurfaceList.h"
-#include "Log.h"
-#include <algorithm>
-
-ExecutionResult SurfacegroupAddSurfaceCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_surfacegroupid);
- Surface* surface = scene.getSurface(m_surfaceid);
-
- if (surfacegroup && surface)
- {
- // check if already a member of the group
- const SurfaceList list = surfacegroup->getList();
- SurfaceListConstIterator iter = std::find (list.begin(), list.end(), surface);
- SurfaceListConstIterator iterEnd = list.end();
-
- if (iter == iterEnd)
- {
- surfacegroup->addElement(surface);
- result = ExecutionSuccess;
- }
- else
- {
- LOG_ERROR("SurfacegroupAddSurfaceCommand", "Surface is already a member of the group");
- }
- }
-
- return result;
-}
-
-const std::string SurfacegroupAddSurfaceCommand::getString()
-{
- std::stringstream description;
- description << "SurfacegroupAddSurfaceCommand("
- << "surfacegroupid=" << m_surfacegroupid
- << ", surfaceid=" << m_surfaceid
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "SurfacegroupCreateCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult SurfacegroupCreateCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
- ExecutionResult result = ExecutionFailed;
-
- SurfaceGroup *surfacegroup = scene.createSurfaceGroup(*m_idReturn, getSenderPid());
-
- if (surfacegroup)
- {
- *m_idReturn = surfacegroup->getID();
-
- LOG_DEBUG("SurfacegroupCreateCommand", "created surfacegroup with id:" << surfacegroup->getID());
- result = ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string SurfacegroupCreateCommand::getString()
-{
- std::stringstream description;
- description << "SurfacegroupCreateCommand("
- << "idReturn=" << m_idReturn << "=" << *m_idReturn
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "SurfacegroupRemoveCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-#include <sstream>
-
-ExecutionResult SurfacegroupRemoveCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_idToRemove);
- if (surfacegroup)
- {
- scene.removeSurfaceGroup(surfacegroup);
- result = ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string SurfacegroupRemoveCommand::getString()
-{
- std::stringstream description;
- description << "SurfacegroupRemoveCommand("
- << "idToRemove=" << m_idToRemove
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "SurfacegroupRemoveSurfaceCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult SurfacegroupRemoveSurfaceCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_surfacegroupid);
- Surface* surface = scene.getSurface(m_surfaceid);
-
- if (surfacegroup && surface)
- {
- surfacegroup->removeElement(surface);
- result = ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string SurfacegroupRemoveSurfaceCommand::getString()
-{
- std::stringstream description;
- description << "SurfacegroupRemoveSurfaceCommand("
- << "surfacegroupid=" << m_surfacegroupid
- << ", surfaceid=" << m_surfaceid
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "SurfacegroupSetOpacityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult SurfacegroupSetOpacityCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_id);
-
- if (surfacegroup)
- {
- LOG_DEBUG("SurfacegroupSetOpacityCommand","new opacity " << m_opacity << " for id: " << m_id);
- result = surfacegroup->setOpacity(m_opacity) ? ExecutionSuccessRedraw : ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string SurfacegroupSetOpacityCommand::getString()
-{
- std::stringstream description;
- description << "SurfacegroupSetOpacityCommand("
- << "id=" << m_id
- << ", opacity=" << m_opacity
- << ")";
- return description.str();
-}
+++ /dev/null
-/***************************************************************************
-*
-* 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 "SurfacegroupSetVisibilityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ExecutionResult SurfacegroupSetVisibilityCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_idtoSet);
-
- if (surfacegroup)
- {
- LOG_DEBUG("SurfacegroupSetVisibilityCommand", "setting visibility: " << m_visibility << " of id " << m_idtoSet);
- result = surfacegroup->setVisibility(m_visibility) ? ExecutionSuccessRedraw : ExecutionSuccess;
- }
-
- return result;
-}
-
-const std::string SurfacegroupSetVisibilityCommand::getString()
-{
- std::stringstream description;
- description << "SurfacegroupSetVisibilityCommand("
- << "idtoSet=" << m_idtoSet
- << ", visibility=" << m_visibility
- << ")";
- return description.str();
-}
}
}
cout << "\n";
-
- // TODO: print layer groups, this layer is part of
}
void printSurfaceProperties(unsigned int surfaceid, const char* prefix)
}
}
cout << "\n";
-
- // TODO: print surface groups, this surface is part of
}
void printScene()
SURFACE_EXAMPLE_VIDEO_APPLICATION = 40
} sceneSurfaces;
-typedef enum e_surfaceGroups
-{
- SURFACEGROUP_NEW = 0
-} sceneSurfaceGroups;
-
-typedef enum e_layerGroups
-{
- LAYERGROUP_NEW = 0
-} sceneLayerGroups;
-
#endif /* _LAYERSCENE_H_ */
void ListAllLayerIDS(t_ilm_message message);
void ListAllLayerIDsOnScreen(t_ilm_message message);
void ListAllSurfaceIDS(t_ilm_message message);
- void ListAllLayerGroupIDS(t_ilm_message message);
- void ListAllSurfaceGroupIDS(t_ilm_message message);
- void ListSurfacesOfSurfacegroup(t_ilm_message message);
- void ListLayersOfLayergroup(t_ilm_message message);
void ListSurfaceofLayer(t_ilm_message message);
void GetPropertiesOfSurface(t_ilm_message message);
void GetPropertiesOfLayer(t_ilm_message message);
void CreateLayerWithDimension(t_ilm_message message);
void CreateLayerFromIdWithDimension(t_ilm_message message);
void RemoveLayer(t_ilm_message message);
- void AddSurfaceToSurfaceGroup(t_ilm_message message);
- void RemoveSurfaceFromSurfaceGroup(t_ilm_message message);
- void AddLayerToLayerGroup(t_ilm_message message);
- void RemoveLayerFromLayerGroup(t_ilm_message message);
void AddSurfaceToLayer(t_ilm_message message);
void RemoveSurfaceFromLayer(t_ilm_message message);
- void CreateSurfaceGroup(t_ilm_message message);
- void CreateSurfaceGroupFromId(t_ilm_message message);
- void RemoveSurfaceGroup(t_ilm_message message);
- void CreateLayerGroup(t_ilm_message message);
- void CreateLayerGroupFromId(t_ilm_message message);
- void RemoveLayerGroup(t_ilm_message message);
void SetSurfaceSourceRegion(t_ilm_message message);
void SetLayerSourceRegion(t_ilm_message message);
void SetSurfaceDestinationRegion(t_ilm_message message);
void GetSurfaceDimension(t_ilm_message message);
void SetSurfaceOpacity(t_ilm_message message);
void SetLayerOpacity(t_ilm_message message);
- void SetSurfacegroupOpacity(t_ilm_message message);
- void SetLayergroupOpacity(t_ilm_message message);
void GetSurfaceOpacity(t_ilm_message message);
void GetLayerOpacity(t_ilm_message message);
- void GetSurfacegroupOpacity(t_ilm_message message);
- void GetLayergroupOpacity(t_ilm_message message);
void SetSurfaceOrientation(t_ilm_message message);
void GetSurfaceOrientation(t_ilm_message message);
void SetLayerOrientation(t_ilm_message message);
void SetLayerVisibility(t_ilm_message message);
void GetSurfaceVisibility(t_ilm_message message);
void GetLayerVisibility(t_ilm_message message);
- void SetSurfacegroupVisibility(t_ilm_message message);
- void SetLayergroupVisibility(t_ilm_message message);
void SetRenderOrderOfLayers(t_ilm_message message);
void SetSurfaceRenderOrderWithinLayer(t_ilm_message message);
void GetLayerType(t_ilm_message message);
#include "ICommandExecutor.h"
#include "CommitCommand.h"
#include "LayerCreateCommand.h"
-#include "LayergroupCreateCommand.h"
#include "SurfaceCreateCommand.h"
-#include "SurfacegroupCreateCommand.h"
#include "SurfaceGetDimensionCommand.h"
#include "LayerGetDimensionCommand.h"
#include "SurfaceGetOpacityCommand.h"
#include "LayerRemoveSurfaceCommand.h"
#include "LayerRemoveCommand.h"
#include "SurfaceRemoveCommand.h"
-#include "LayergroupRemoveCommand.h"
-#include "SurfacegroupRemoveCommand.h"
#include "SurfaceGetOrientationCommand.h"
#include "LayerGetOrientationCommand.h"
-#include "LayergroupAddLayerCommand.h"
-#include "LayergroupRemoveLayerCommand.h"
#include "LayerSetDestinationRectangleCommand.h"
#include "SurfaceSetDestinationRectangleCommand.h"
#include "LayerSetOpacityCommand.h"
-#include "LayergroupSetOpacityCommand.h"
#include "SurfaceSetOpacityCommand.h"
-#include "SurfacegroupSetOpacityCommand.h"
#include "LayerSetSourceRectangleCommand.h"
#include "SurfaceSetSourceRectangleCommand.h"
#include "LayerSetOrientationCommand.h"
#include "SurfaceSetOrientationCommand.h"
-#include "SurfacegroupAddSurfaceCommand.h"
-#include "SurfacegroupRemoveSurfaceCommand.h"
#include "LayerSetVisibilityCommand.h"
#include "SurfaceSetVisibilityCommand.h"
-#include "LayergroupSetVisibilityCommand.h"
-#include "SurfacegroupSetVisibilityCommand.h"
#include "DebugCommand.h"
#include "ExitCommand.h"
#include "ScreenSetRenderOrderCommand.h"
{ "ListAllLayerIDS", &GenericCommunicator::ListAllLayerIDS },
{ "ListAllLayerIDsOnScreen", &GenericCommunicator::ListAllLayerIDsOnScreen },
{ "ListAllSurfaceIDS", &GenericCommunicator::ListAllSurfaceIDS },
- { "ListAllLayerGroupIDS", &GenericCommunicator::ListAllLayerGroupIDS },
- { "ListAllSurfaceGroupIDS", &GenericCommunicator::ListAllSurfaceGroupIDS },
- { "ListSurfacesOfSurfacegroup", &GenericCommunicator::ListSurfacesOfSurfacegroup },
- { "ListLayersOfLayergroup", &GenericCommunicator::ListLayersOfLayergroup },
{ "ListSurfaceofLayer", &GenericCommunicator::ListSurfaceofLayer },
{ "GetPropertiesOfSurface", &GenericCommunicator::GetPropertiesOfSurface },
{ "GetPropertiesOfLayer", &GenericCommunicator::GetPropertiesOfLayer },
{ "CreateLayerWithDimension", &GenericCommunicator::CreateLayerWithDimension },
{ "CreateLayerFromIdWithDimension", &GenericCommunicator::CreateLayerFromIdWithDimension },
{ "RemoveLayer", &GenericCommunicator::RemoveLayer },
- { "AddSurfaceToSurfaceGroup", &GenericCommunicator::AddSurfaceToSurfaceGroup },
- { "RemoveSurfaceFromSurfaceGroup", &GenericCommunicator::RemoveSurfaceFromSurfaceGroup },
- { "AddLayerToLayerGroup", &GenericCommunicator::AddLayerToLayerGroup },
- { "RemoveLayerFromLayerGroup", &GenericCommunicator::RemoveLayerFromLayerGroup },
{ "AddSurfaceToLayer", &GenericCommunicator::AddSurfaceToLayer },
{ "RemoveSurfaceFromLayer", &GenericCommunicator::RemoveSurfaceFromLayer },
- { "CreateSurfaceGroup", &GenericCommunicator::CreateSurfaceGroup },
- { "CreateSurfaceGroupFromId", &GenericCommunicator::CreateSurfaceGroupFromId },
- { "RemoveSurfaceGroup", &GenericCommunicator::RemoveSurfaceGroup },
- { "CreateLayerGroup", &GenericCommunicator::CreateLayerGroup },
- { "CreateLayerGroupFromId", &GenericCommunicator::CreateLayerGroupFromId },
- { "RemoveLayerGroup", &GenericCommunicator::RemoveLayerGroup },
{ "SetSurfaceSourceRegion", &GenericCommunicator::SetSurfaceSourceRegion },
{ "SetLayerSourceRegion", &GenericCommunicator::SetLayerSourceRegion },
{ "SetSurfaceDestinationRegion", &GenericCommunicator::SetSurfaceDestinationRegion },
{ "GetSurfaceDimension", &GenericCommunicator::GetSurfaceDimension },
{ "SetSurfaceOpacity", &GenericCommunicator::SetSurfaceOpacity },
{ "SetLayerOpacity", &GenericCommunicator::SetLayerOpacity },
- { "SetSurfacegroupOpacity", &GenericCommunicator::SetSurfacegroupOpacity },
- { "SetLayergroupOpacity", &GenericCommunicator::SetLayergroupOpacity },
{ "GetSurfaceOpacity", &GenericCommunicator::GetSurfaceOpacity },
{ "GetLayerOpacity", &GenericCommunicator::GetLayerOpacity },
{ "SetSurfaceOrientation", &GenericCommunicator::SetSurfaceOrientation },
{ "SetLayerVisibility", &GenericCommunicator::SetLayerVisibility },
{ "GetSurfaceVisibility", &GenericCommunicator::GetSurfaceVisibility },
{ "GetLayerVisibility", &GenericCommunicator::GetLayerVisibility },
- { "SetSurfacegroupVisibility", &GenericCommunicator::SetSurfacegroupVisibility },
- { "SetLayergroupVisibility", &GenericCommunicator::SetLayergroupVisibility },
{ "SetRenderOrderOfLayers", &GenericCommunicator::SetRenderOrderOfLayers },
{ "SetSurfaceRenderOrderWithinLayer", &GenericCommunicator::SetSurfaceRenderOrderWithinLayer },
{ "GetLayerType", &GenericCommunicator::GetLayerType },
m_ipcModule.destroyMessage(response);
}
-void GenericCommunicator::ListAllLayerGroupIDS(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- uint* array = NULL;
- uint length = 0;
- m_executor->getScene()->lockScene();
- m_executor->getScene()->getLayerGroupIDs(&length, &array);
- m_executor->getScene()->unlockScene();
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUintArray(response, array, length);
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::ListAllSurfaceGroupIDS(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- uint* array = NULL;
- uint length = 0;
- m_executor->getScene()->lockScene();
- m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
- m_executor->getScene()->unlockScene();
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUintArray(response, array, length);
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::ListSurfacesOfSurfacegroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- uint id = 0;
- m_ipcModule.getUint(message, &id);
- m_executor->getScene()->lockScene();
- SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
- if (NULL != sg)
- {
- std::list<Surface*> surfaces = sg->getList();
- uint length = surfaces.size();
- uint* array = new uint[length];
- uint arrayPos = 0;
-
- for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
- {
- Surface* s = *it;
- array[arrayPos] = s->getID();
- ++arrayPos;
- }
- m_executor->getScene()->unlockScene();
-
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUintArray(response, array, length);
- }
- else
- {
- m_executor->getScene()->unlockScene();
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::ListLayersOfLayergroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- uint id = 0;
- m_ipcModule.getUint(message, &id);
- m_executor->getScene()->lockScene();
- LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
- if (NULL != sg)
- {
- std::list<Layer*> layers = sg->getList();
-
- uint length = layers.size();
- uint* array = new uint[length];
- uint arrayPos = 0;
-
- for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
- {
- Layer* l = *it;
- array[arrayPos] = l->getID();
- ++arrayPos;
- }
- m_executor->getScene()->unlockScene();
-
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUintArray(response, array, length);
- }
- else
- {
- m_executor->getScene()->unlockScene();
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
void GenericCommunicator::ListSurfaceofLayer(t_ilm_message message)
{
t_ilm_message response;
m_ipcModule.destroyMessage(response);
}
-void GenericCommunicator::AddSurfaceToSurfaceGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint surfaceid = 0;
- uint surfacegroupid = 0;
-
- m_ipcModule.getUint(message, &surfaceid);
- m_ipcModule.getUint(message, &surfacegroupid);
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(clientPid, surfacegroupid, surfaceid));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::RemoveSurfaceFromSurfaceGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint surfaceid = 0;
- uint surfacegroupid = 0;
-
- m_ipcModule.getUint(message, &surfaceid);
- m_ipcModule.getUint(message, &surfacegroupid);
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(clientPid, surfacegroupid, surfaceid));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::AddLayerToLayerGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint layerid = 0;
- uint layergroupid = 0;
-
- m_ipcModule.getUint(message, &layerid);
- m_ipcModule.getUint(message, &layergroupid);
-
- t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(clientPid, layergroupid, layerid));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::RemoveLayerFromLayerGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint layerid = 0;
- uint layergroupid = 0;
-
- m_ipcModule.getUint(message, &layerid);
- m_ipcModule.getUint(message, &layergroupid);
-
- t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(clientPid, layergroupid, layerid));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
void GenericCommunicator::AddSurfaceToLayer(t_ilm_message message)
{
t_ilm_message response;
m_ipcModule.destroyMessage(response);
}
-void GenericCommunicator::CreateSurfaceGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint newID = GraphicalObject::INVALID_ID;
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(clientPid, &newID));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUint(response, newID);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_ALREADY_INUSE);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::CreateSurfaceGroupFromId(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint newID = GraphicalObject::INVALID_ID;
-
- m_ipcModule.getUint(message, &newID);
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(clientPid, &newID));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUint(response, newID);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_ALREADY_INUSE);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::RemoveSurfaceGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint param = 0;
- m_ipcModule.getUint(message, ¶m);
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(clientPid, param));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::CreateLayerGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint newID = GraphicalObject::INVALID_ID;
-
- t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(clientPid, &newID));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUint(response, newID);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_ALREADY_INUSE);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::CreateLayerGroupFromId(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint newID = GraphicalObject::INVALID_ID;
-
- m_ipcModule.getUint(message, &newID);
-
- t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(clientPid, &newID));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- m_ipcModule.appendUint(response, newID);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_ALREADY_INUSE);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::RemoveLayerGroup(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint param = 0;
- m_ipcModule.getUint(message, ¶m);
-
- t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(clientPid, param));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
void GenericCommunicator::SetSurfaceSourceRegion(t_ilm_message message)
{
t_ilm_message response;
m_ipcModule.destroyMessage(response);
}
-void GenericCommunicator::SetSurfacegroupOpacity(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint id = 0;
- double param = 0.0;
-
- m_ipcModule.getUint(message, &id);
- m_ipcModule.getDouble(message, ¶m);
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(clientPid, id, param));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::SetLayergroupOpacity(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint id = 0;
- double param = 0.0;
-
- m_ipcModule.getUint(message, &id);
- m_ipcModule.getDouble(message, ¶m);
-
- t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(clientPid, id, param));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
void GenericCommunicator::GetSurfaceOpacity(t_ilm_message message)
{
t_ilm_message response;
m_ipcModule.destroyMessage(response);
}
-void GenericCommunicator::SetSurfacegroupVisibility(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint groupid = 0;
- t_ilm_bool myparam = ILM_FALSE;
-
- m_ipcModule.getUint(message, &groupid);
- m_ipcModule.getBool(message, &myparam);
-
- t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(clientPid, groupid, myparam));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-void GenericCommunicator::SetLayergroupVisibility(t_ilm_message message)
-{
- t_ilm_message response;
- t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- t_ilm_uint clientPid = m_executor->getSenderPid(clientHandle);
- uint groupid = 0;
- t_ilm_bool myparam = ILM_FALSE;
-
- m_ipcModule.getUint(message, &groupid);
- m_ipcModule.getBool(message, &myparam);
-
- t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(clientPid, groupid, myparam));
- if (status)
- {
- response = m_ipcModule.createResponse(message);
- }
- else
- {
- response = m_ipcModule.createErrorResponse(message);
- m_ipcModule.appendString(response, RESOURCE_NOT_FOUND);
- }
-
- m_ipcModule.sendToClients(response, &clientHandle, 1);
- m_ipcModule.destroyMessage(response);
-}
-
-
void GenericCommunicator::SetRenderOrderOfLayers(t_ilm_message message)
{
t_ilm_message response;
#include "ICommandExecutor.h"
#include "CommitCommand.h"
#include "LayerCreateCommand.h"
-#include "LayergroupCreateCommand.h"
#include "SurfaceCreateCommand.h"
-#include "SurfacegroupCreateCommand.h"
#include "SurfaceGetDimensionCommand.h"
#include "LayerGetDimensionCommand.h"
#include "SurfaceGetOpacityCommand.h"
#include "LayerRemoveSurfaceCommand.h"
#include "LayerRemoveCommand.h"
#include "SurfaceRemoveCommand.h"
-#include "LayergroupRemoveCommand.h"
-#include "SurfacegroupRemoveCommand.h"
#include "SurfaceGetOrientationCommand.h"
#include "LayerGetOrientationCommand.h"
-#include "LayergroupAddLayerCommand.h"
-#include "LayergroupRemoveLayerCommand.h"
#include "LayerSetDestinationRectangleCommand.h"
#include "SurfaceSetDestinationRectangleCommand.h"
#include "LayerSetOpacityCommand.h"
-#include "LayergroupSetOpacityCommand.h"
#include "SurfaceSetOpacityCommand.h"
-#include "SurfacegroupSetOpacityCommand.h"
#include "LayerSetSourceRectangleCommand.h"
#include "SurfaceSetSourceRectangleCommand.h"
#include "LayerSetOrientationCommand.h"
#include "SurfaceSetOrientationCommand.h"
-#include "SurfacegroupAddSurfaceCommand.h"
-#include "SurfacegroupRemoveSurfaceCommand.h"
#include "LayerSetVisibilityCommand.h"
#include "SurfaceSetVisibilityCommand.h"
-#include "LayergroupSetVisibilityCommand.h"
-#include "SurfacegroupSetVisibilityCommand.h"
#include "DebugCommand.h"
#include "ExitCommand.h"
#include "ScreenSetRenderOrderCommand.h"
ASSERT_NE(-1, system((DBUSCOMMAND + std::string("ListAllLayerIDS")).c_str()));
}
-TEST_F(DBUSCommunicatorTest, listAlllayerGroupIDS) {
- std::list<int> defaultlist;
- // Sets the default return value for type Bar.
- DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
- DefaultValue<std::list<int> >::Set(defaultlist);
- EXPECT_CALL(this->layerlist, getLayerGroupIDs(NotNull(),NotNull()) ).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("ListAllLayerGroupIDS")).c_str()));
-}
-
-TEST_F(DBUSCommunicatorTest, listAllSurfaceGroupIDS) {
- std::list<int> defaultlist;
- // Sets the default return value for type Bar.
- DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
- DefaultValue<std::list<int> >::Set(defaultlist);
- EXPECT_CALL(this->layerlist, getSurfaceGroupIDs(NotNull(),NotNull() )).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("ListAllSurfaceGroupIDS")).c_str()));
-}
-
-TEST_F(DBUSCommunicatorTest, listSurfacesOfSurfacegroup) {
-
- std::list<int> defaultlist;
- DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
- // Sets the default return value for type Bar.
- DefaultValue<std::list<int> >::Set(defaultlist);
- DefaultValue<SurfaceGroup*>::Set(new SurfaceGroup(0));
- EXPECT_CALL(this->layerlist, getSurfaceGroup(Eq(84567u) )).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("ListSurfacesOfSurfacegroup uint32:84567")).c_str()));
-
-}
-
-TEST_F(DBUSCommunicatorTest, listlayersOflayergroup) {
-
- std::list<int> defaultlist;
- // Sets the default return value for type Bar.
- DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
- DefaultValue<std::list<int> >::Set(defaultlist);
- DefaultValue<LayerGroup*>::Set(new LayerGroup(0));
-
- EXPECT_CALL(this->layerlist, getLayerGroup(Eq(345u) )).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("ListLayersOfLayergroup uint32:345")).c_str()));
-
-}
-
TEST_F(DBUSCommunicatorTest, listSurfaceoflayer) {
Scene scene;
ASSERT_NE(-1, system((DBUSCOMMAND + std::string("GetLayerOpacity uint32:44 ")).c_str()));
}
-MATCHER_P2(SurfacegroupSetOpacityCommandEq, id, Opacity, "%(*)s") {
- return ((SurfacegroupSetOpacityCommand*)arg)->m_id == id
- && ((SurfacegroupSetOpacityCommand*)arg)->m_opacity == Opacity;
-}
-
-TEST_F(DBUSCommunicatorTest, SetSurfacegroupOpacity) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetOpacityCommandEq(36u,0.88))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetSurfacegroupOpacity uint32:36 double:0.88")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetOpacityCommandEq(44u,0.001))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetSurfacegroupOpacity uint32:44 double:0.001")).c_str()));
-}
-
-MATCHER_P2(LayergroupSetOpacityCommandEq, id, Opacity, "%(*)s"){
- return ((LayergroupSetOpacityCommand*)arg)->m_id == id
- && ((LayergroupSetOpacityCommand*)arg)->m_opacity == Opacity;
-}
-
-TEST_F(DBUSCommunicatorTest, SetlayergroupOpacity) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetOpacityCommandEq(36u,0.88))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayergroupOpacity uint32:36 double:0.88")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetOpacityCommandEq(44u,0.001))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayergroupOpacity uint32:44 double:0.001")).c_str()));
-}
-
MATCHER_P2(SurfaceSetOrientationCommandEq, id, Orientation, "%(*)s") {
return ((SurfaceSetOrientationCommand*)arg)->m_id == id
&& ((SurfaceSetOrientationCommand*)arg)->m_orientation == Orientation;
ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayerVisibility uint32:44 boolean:true")).c_str()));
}
-MATCHER_P2(SurfacegroupSetVisibilityCommandEq, id, visibility, "%(*)s"){
- return ((SurfacegroupSetVisibilityCommand*)arg)->m_idtoSet == id
- && ((SurfacegroupSetVisibilityCommand*)arg)->m_visibility == visibility;
-}
-
-TEST_F(DBUSCommunicatorTest, SetSurfacegroupVisibility) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(36u,false))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:36 boolean:false")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(44u,true))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:44 boolean:true")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(36u,false))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:36 boolean:false")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(44u,true))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:44 boolean:true")).c_str()));
-
-}
-
-MATCHER_P2(LayergroupSetVisibilityCommandEq, id, visibility, "%(*)s"){
- return ((LayergroupSetVisibilityCommand*)arg)->m_idtoSet == id
- && ((LayergroupSetVisibilityCommand*)arg)->m_visibility == visibility;
-}
-
-TEST_F(DBUSCommunicatorTest, SetlayergroupVisibility) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(36u,false))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:36 boolean:false")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(44u,true))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:44 boolean:true")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(36u,false))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:36 boolean:false")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(44u,true))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:44 boolean:true")).c_str()));
-}
-
-MATCHER_P2(SurfacegroupAddSurfaceCommandEq, surfaceid, surfacegroupid, "%(*)s"){
- return ((SurfacegroupAddSurfaceCommand*)arg)->m_surfacegroupid == surfacegroupid
- && ((SurfacegroupAddSurfaceCommand*)arg)->m_surfaceid == surfaceid;
-
-}
-TEST_F(DBUSCommunicatorTest, AddSurfaceToSurfaceGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute( SurfacegroupAddSurfaceCommandEq(36u,77u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("AddSurfaceToSurfaceGroup uint32:36 uint32:77")).c_str()));
-}
-
-MATCHER_P2(SurfacegroupRemoveSurfaceCommandEq, surfacegroupid, surfaceid, "%(*)s"){
- return ((SurfacegroupRemoveSurfaceCommand*)arg)->m_surfacegroupid == surfacegroupid
- && ((SurfacegroupRemoveSurfaceCommand*)arg)->m_surfaceid == surfaceid;
-}
-
-TEST_F(DBUSCommunicatorTest, RemoveSurfaceFromSurfaceGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute( SurfacegroupAddSurfaceCommandEq(36u,77u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveSurfaceFromSurfaceGroup uint32:36 uint32:77")).c_str()));
-}
-
-MATCHER_P2(LayergroupAddLayerCommandEq, layerid, layergroupid, "%(*)s"){
- return ((LayergroupAddLayerCommand*)arg)->m_layergroupid == layergroupid
- && ((LayergroupAddLayerCommand*)arg)->m_layerid == layerid;
-}
-
-TEST_F(DBUSCommunicatorTest, AddlayerTolayerGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute( LayergroupAddLayerCommandEq(36u,77u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("AddLayerToLayerGroup uint32:36 uint32:77")).c_str()));
-}
-
-MATCHER_P2(LayergroupRemoveLayerCommandEq, layerid,layergroupid, "%(*)s"){
- return ((LayergroupRemoveLayerCommand*)arg)->m_layergroupid == layergroupid
- && ((LayergroupRemoveLayerCommand*)arg)->m_layerid == layerid;
-}
-
-TEST_F(DBUSCommunicatorTest, RemovelayerFromlayerGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute( LayergroupRemoveLayerCommandEq(36u,77u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveLayerFromLayerGroup uint32:36 uint32:77")).c_str()));
-}
-
MATCHER_P2(LayerAddSurfaceCommandEq, surfaceid, layerid, "%(*)s"){
return ((LayerAddSurfaceCommand*)arg)->m_layerid == layerid
&& ((LayerAddSurfaceCommand*)arg)->m_surfaceid == surfaceid;
ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveSurfaceFromLayer uint32:36 uint32:77")).c_str()));
}
-/*
-TEST_F(DBUSCommunicatorTest, CreateSurfaceGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute()).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("CreateSurfaceGroup")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeSurfaceGroup,PIXELFORMAT_R8))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("CreateSurfaceGroup")).c_str()));
-}
-*/
-
-MATCHER_P(SurfacegroupRemoveCommandEq, idToRemove, "%(*)s") {
- return ((SurfacegroupRemoveCommand*)arg)->m_idToRemove == idToRemove;
-}
-
-TEST_F(DBUSCommunicatorTest, RemoveSurfaceGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupRemoveCommandEq(8554u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveSurfaceGroup uint32:8554")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupRemoveCommandEq(34589u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveSurfaceGroup uint32:34589")).c_str()));
-}
-
-/*
-TEST_F(DBUSCommunicatorTest, CreatelayerGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeLayerGroup,PIXELFORMAT_R8))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("CreateLayerGroup")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeLayerGroup,PIXELFORMAT_R8))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("CreateLayerGroup")).c_str()));
-}
-*/
-
-MATCHER_P(LayergroupRemoveCommandEq, idToRemove, "%(*)s") {
- return ((LayergroupRemoveCommand*)arg)->m_idToRemove == idToRemove;
-}
-
-TEST_F(DBUSCommunicatorTest, RemovelayerGroup) {
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupRemoveCommandEq(8554u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveLayerGroup uint32:8554")).c_str()));
-
- EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupRemoveCommandEq(34589u))).Times(1);
- ASSERT_NE(-1, system((DBUSCOMMAND + std::string("RemoveLayerGroup uint32:34589")).c_str()));
-}
-
MATCHER_P(LayerGetDimensionCommandEq, id, "%(*)s") {
return ((LayerGetDimensionCommand*)arg)->m_id == id;
}
public:
MOCK_METHOD1(createLayer, Layer*(unsigned int));
MOCK_METHOD1(createSurface, Surface*(unsigned int));
- MOCK_METHOD1(createLayerGroup, LayerGroup*(unsigned int));
- MOCK_METHOD1(createSurfaceGroup, SurfaceGroup*(unsigned int));
MOCK_METHOD1(removeLayer, bool(Layer*));
MOCK_METHOD1(removeSurface, bool(Surface*));
MOCK_CONST_METHOD1(getLayer, Layer*(unsigned int));
MOCK_CONST_METHOD1(getSurface, Surface*(unsigned int));
- MOCK_CONST_METHOD1(getSurfaceGroup, SurfaceGroup*(unsigned int));
- MOCK_CONST_METHOD1(getLayerGroup, LayerGroup*(unsigned int id));
MOCK_CONST_METHOD2(getLayerIDs, void(unsigned int*,unsigned int**));
MOCK_CONST_METHOD3(getLayerIDsOfScreen, bool(unsigned int,unsigned int*,unsigned int**));
MOCK_CONST_METHOD2(getSurfaceIDs, void(unsigned int*,unsigned int**));
- MOCK_CONST_METHOD2(getLayerGroupIDs, void(unsigned int*,unsigned int**));
- MOCK_CONST_METHOD2(getSurfaceGroupIDs, void(unsigned int*,unsigned int**));
MOCK_METHOD0(lockScene, void());
MOCK_METHOD0(unlockScene, void());
};
{ "ListAllLayerIDS", "", "au" },
{ "ListAllLayerIDsOnScreen", "u", "au" },
{ "ListAllSurfaceIDS", "", "au" },
- { "ListAllLayerGroupIDS", "", "au" },
- { "ListAllSurfaceGroupIDS", "", "au" },
- { "ListSurfacesOfSurfacegroup", "u", "au" },
- { "ListLayersOfLayergroup", "u", "au" },
{ "ListSurfaceofLayer", "u", "au" },
{ "GetPropertiesOfSurface", "u", "duuuuuuuuuuybu" },
{ "GetPropertiesOfLayer", "u", "duuuuuuuuuuyb" },
{ "CreateLayerWithDimension", "uu", "u" },
{ "CreateLayerFromIdWithDimension", "uuu", "u" },
{ "RemoveLayer", "u", "" },
- { "AddSurfaceToSurfaceGroup", "uu", "" },
- { "RemoveSurfaceFromSurfaceGroup", "uu", "" },
- { "AddLayerToLayerGroup", "uu", "" },
- { "RemoveLayerFromLayerGroup", "uu", "" },
{ "AddSurfaceToLayer", "uu", "" },
{ "RemoveSurfaceFromLayer", "uu", "" },
- { "CreateSurfaceGroup", "", "u" },
- { "CreateSurfaceGroupFromId", "u", "u" },
- { "RemoveSurfaceGroup", "u", "" },
- { "CreateLayerGroup", "", "u" },
- { "CreateLayerGroupFromId", "u", "u" },
- { "RemoveLayerGroup", "u", "" },
{ "SetSurfaceSourceRegion", "uuuuu", "" },
{ "SetLayerSourceRegion", "uuuuu", "" },
{ "SetSurfaceDestinationRegion", "uuuuu", "" },
{ "GetSurfaceDimension", "u", "uu" },
{ "SetSurfaceOpacity", "ud", "" },
{ "SetLayerOpacity", "ud", "" },
- { "SetSurfacegroupOpacity", "ud", "" },
- { "SetLayergroupOpacity", "ud", "" },
{ "GetSurfaceOpacity", "u", "d" },
{ "GetLayerOpacity", "u", "d" },
{ "SetSurfaceOrientation", "uu", "" },
{ "SetLayerVisibility", "ub", "" },
{ "GetSurfaceVisibility", "u", "b" },
{ "GetLayerVisibility", "u", "b" },
- { "SetSurfacegroupVisibility", "ub", "" },
- { "SetLayergroupVisibility", "ub", "" },
{ "SetRenderOrderOfLayers", "auu", "" },
{ "SetSurfaceRenderOrderWithinLayer", "uau", "" },
{ "GetLayerType", "u", "u" },
SURFACE_EXAMPLE_VIDEO_APPLICATION = 40
} sceneSurfaces;
-typedef enum e_surfaceGroups
-{
- SURFACEGROUP_NEW = 0
-} sceneSurfaceGroups;
-
-typedef enum e_layerGroups
-{
- LAYERGROUP_NEW = 0
-} sceneLayerGroups;
-
#endif /* _LAYERSCENE_H_ */
+next
+------------------
+Improvements:
+- removed LayerGroups, SurfaceGroups
+
+
Version 0.9.9
------------------
This version includes the following enhancements.
To support hardware layers and to get a better interoperability with other applications
and platforms the API was extended by the following features :
-* Layer, Surface and Group Ids can be applied by from the client side too.
+* Layer and Surface and Group Ids can be applied by from the client side too.
* IlmMatrix class is now available in the LayerManagerUtils library, to support
simple 3D / 2D transformations
<td>Logical container for multiple surfaces.</td>
</tr>
<tr>
- <td>LayerGroup</td>
- <td>Groups multiple layers to a logical group, so commands can target multiple layers at once.</td>
- </tr>
- <tr>
- <td>SurfaceGroup</td>
- <td>Groups multiple surfaces to a logical group, so commands can target multiple surfaces at once.</td>
- </tr>
- <tr>
<td>IPC</td>
<td>Inter Process Communication.</td>
</tr>
to change the content of the shown application during runtime, sometimes it is
required that different application content is on top of other applications. An
important aspect is that a defined interface is given to be able to change the
-application layout during runtime. Additionally means are provided in order to
-group surfaces of applications and layers containing surfaces for easier handling
-as a single entity.
+application layout during runtime.
-\image html ./doc/images/relation_of_display_layers_surfaces.png Relation of displays, surfaces and layers and groups thereof
-\image latex ./doc/images/relation_of_display_layers_surfaces.png Relation of displays, surfaces and layers and groups thereof
+\image html ./doc/images/relation_of_display_layers_surfaces.png Relation of displays, surfaces and layers (TODO: update picture - remove groups)
+\image latex ./doc/images/relation_of_display_layers_surfaces.png Relation of displays, surfaces and layers (TODO: update picture - remove groups)
-The Types Surface, Layer, SurfaceGroup and LayerGroup are logical entities contained
+The Types Surface and Layer are logical entities contained
in corresponding classes within the layermanager. They are not platform dependant,
they are just logical entities or data containers keeping the values for opacity,
position etc. The class Surface contains a pointer to a platform dependant
The control is responsible for loading communication and renderer packages to be used. The
control initiates the main class, which in turn contains and manages the scene with the list
-of layers and their surfaces through the Scene object, and the list of logical groups.
+of layers and their surfaces through the Scene object.
The renderer packages are given access to these lists by the control and the communication
packages must be able to obtain information about properties requested by clients (e.g.
“SurfaceGetVisibility”).
\section testingScene Scene
The implementation of the Scene can also be tested by automatic tests,
-inserting new layers, groups and surfaces, then changing properties and comparing
+inserting new layers and surfaces, then changing properties and comparing
the results of subsequent calls to getter methods with the desired values.
*/