summaryrefslogtreecommitdiff
path: root/LayerManagerCommands
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2011-11-24 12:04:26 +0100
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2011-11-29 14:50:33 +0100
commit515e0bf0be75884531f142cee5c33b3e31298b3c (patch)
tree47d69ec2f73b85256bb231cea1ffaef39bbb21c4 /LayerManagerCommands
parent53d0780c2e193d74df501a3bf52ded9db903aeaf (diff)
downloadlayer_management-515e0bf0be75884531f142cee5c33b3e31298b3c.tar.gz
refactored LayerManagerCommands
replaced CreateCommand with type specific create commands refactored LayerManagerCommands to handle only one case each refactored commands GetDimension GetOpacity GetPixelformat to be type specific refactored GetOrientationCommand refactored GetPositionCommand refactored GetVisibilityCommand refactored RemoveCommand refactored SetDestinationRectangleCommand refactored SetDimensionCommand refactored SetLayerTypeCommand SetLayerOrderCommand refactored ScreenShotCommand refactored SetOpacityCommand refactored SetOrderWithinLayerCommand refactored SetUniformsCommand refactored SetShaderCommand refactored SetOrientationCommand refactored SetPositionCommand refactored SetSourceRectangleCommand refactored SetVisibilityCommand; cleaned up #includes in command header files
Diffstat (limited to 'LayerManagerCommands')
-rw-r--r--LayerManagerCommands/CMakeLists.txt2
-rw-r--r--LayerManagerCommands/include/LayerCreateCommand.h43
-rw-r--r--LayerManagerCommands/include/LayerDumpCommand.h (renamed from LayerManagerCommands/include/ScreenShotCommand.h)12
-rw-r--r--LayerManagerCommands/include/LayerGetDimensionCommand.h (renamed from LayerManagerCommands/include/GetDimensionCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerGetOpacityCommand.h (renamed from LayerManagerCommands/include/GetOpacityCommand.h)15
-rw-r--r--LayerManagerCommands/include/LayerGetOrientationCommand.h (renamed from LayerManagerCommands/include/GetOrientationCommand.h)12
-rw-r--r--LayerManagerCommands/include/LayerGetPositionCommand.h (renamed from LayerManagerCommands/include/GetPositionCommand.h)12
-rw-r--r--LayerManagerCommands/include/LayerGetVisibilityCommand.h (renamed from LayerManagerCommands/include/GetVisibilityCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerRemoveCommand.h (renamed from LayerManagerCommands/include/RemoveCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h (renamed from LayerManagerCommands/include/SetSourceRectangleCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetDimensionCommand.h (renamed from LayerManagerCommands/include/SetDimensionCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetOpacityCommand.h (renamed from LayerManagerCommands/include/SetOpacityCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetOrientationCommand.h (renamed from LayerManagerCommands/include/SetOrientationCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetPositionCommand.h (renamed from LayerManagerCommands/include/SetPositionCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetRenderOrderCommand.h (renamed from LayerManagerCommands/include/SetOrderWithinLayerCommand.h)10
-rw-r--r--LayerManagerCommands/include/LayerSetSourceRectangleCommand.h (renamed from LayerManagerCommands/include/SetDestinationRectangleCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayerSetTypeCommand.h (renamed from LayerManagerCommands/include/SetLayerTypeCommand.h)10
-rw-r--r--LayerManagerCommands/include/LayerSetVisibilityCommand.h (renamed from LayerManagerCommands/include/SetVisibilityCommand.h)14
-rw-r--r--LayerManagerCommands/include/LayergroupCreateCommand.h41
-rw-r--r--LayerManagerCommands/include/LayergroupGetOpacityCommand.h43
-rw-r--r--LayerManagerCommands/include/LayergroupGetVisibilityCommand.h42
-rw-r--r--LayerManagerCommands/include/LayergroupRemoveCommand.h40
-rw-r--r--LayerManagerCommands/include/LayergroupSetOpacityCommand.h42
-rw-r--r--LayerManagerCommands/include/LayergroupSetVisibilityCommand.h42
-rw-r--r--LayerManagerCommands/include/ScreenDumpCommand.h39
-rw-r--r--LayerManagerCommands/include/ScreenSetRenderOrderCommand.h (renamed from LayerManagerCommands/include/SetLayerOrderCommand.h)10
-rw-r--r--LayerManagerCommands/include/ShaderCreateCommand.h (renamed from LayerManagerCommands/include/CreateShaderCommand.h)10
-rw-r--r--LayerManagerCommands/include/ShaderDestroyCommand.h (renamed from LayerManagerCommands/include/DestroyShaderCommand.h)10
-rw-r--r--LayerManagerCommands/include/ShaderSetUniformsCommand.h (renamed from LayerManagerCommands/include/SetUniformsCommand.h)10
-rw-r--r--LayerManagerCommands/include/SurfaceCreateCommand.h (renamed from LayerManagerCommands/include/CreateCommand.h)20
-rw-r--r--LayerManagerCommands/include/SurfaceDumpCommand.h39
-rw-r--r--LayerManagerCommands/include/SurfaceGetDimensionCommand.h42
-rw-r--r--LayerManagerCommands/include/SurfaceGetOpacityCommand.h43
-rw-r--r--LayerManagerCommands/include/SurfaceGetOrientationCommand.h40
-rw-r--r--LayerManagerCommands/include/SurfaceGetPixelformatCommand.h (renamed from LayerManagerCommands/include/GetPixelformatCommand.h)14
-rw-r--r--LayerManagerCommands/include/SurfaceGetPositionCommand.h40
-rw-r--r--LayerManagerCommands/include/SurfaceGetVisibilityCommand.h42
-rw-r--r--LayerManagerCommands/include/SurfaceRemoveCommand.h40
-rw-r--r--LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h45
-rw-r--r--LayerManagerCommands/include/SurfaceSetDimensionCommand.h43
-rw-r--r--LayerManagerCommands/include/SurfaceSetOpacityCommand.h42
-rw-r--r--LayerManagerCommands/include/SurfaceSetOrientationCommand.h43
-rw-r--r--LayerManagerCommands/include/SurfaceSetPositionCommand.h43
-rw-r--r--LayerManagerCommands/include/SurfaceSetShaderCommand.h (renamed from LayerManagerCommands/include/SetShaderCommand.h)10
-rw-r--r--LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h45
-rw-r--r--LayerManagerCommands/include/SurfaceSetVisibilityCommand.h42
-rw-r--r--LayerManagerCommands/include/SurfacegroupCreateCommand.h41
-rw-r--r--LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h43
-rw-r--r--LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h42
-rw-r--r--LayerManagerCommands/include/SurfacegroupRemoveCommand.h40
-rw-r--r--LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h42
-rw-r--r--LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h42
-rw-r--r--LayerManagerCommands/src/CreateCommand.cpp147
-rw-r--r--LayerManagerCommands/src/LayerCreateCommand.cpp61
-rw-r--r--LayerManagerCommands/src/LayerDumpCommand.cpp79
-rw-r--r--LayerManagerCommands/src/LayerGetDimensionCommand.cpp (renamed from LayerManagerCommands/src/GetDimensionCommand.cpp)36
-rw-r--r--LayerManagerCommands/src/LayerGetOpacityCommand.cpp (renamed from LayerManagerCommands/src/GetOpacityCommand.cpp)40
-rw-r--r--LayerManagerCommands/src/LayerGetOrientationCommand.cpp (renamed from LayerManagerCommands/src/GetOrientationCommand.cpp)45
-rw-r--r--LayerManagerCommands/src/LayerGetPositionCommand.cpp (renamed from LayerManagerCommands/src/GetPositionCommand.cpp)34
-rw-r--r--LayerManagerCommands/src/LayerGetVisibilityCommand.cpp (renamed from LayerManagerCommands/src/GetVisibilityCommand.cpp)44
-rw-r--r--LayerManagerCommands/src/LayerRemoveCommand.cpp53
-rw-r--r--LayerManagerCommands/src/LayerSetDestinationRectangleCommand.cpp (renamed from LayerManagerCommands/src/SetDestinationRectangleCommand.cpp)34
-rw-r--r--LayerManagerCommands/src/LayerSetDimensionCommand.cpp (renamed from LayerManagerCommands/src/SetDimensionCommand.cpp)34
-rw-r--r--LayerManagerCommands/src/LayerSetOpacityCommand.cpp (renamed from LayerManagerCommands/src/SetOpacityCommand.cpp)42
-rw-r--r--LayerManagerCommands/src/LayerSetOrientationCommand.cpp (renamed from LayerManagerCommands/src/SetOrientationCommand.cpp)33
-rw-r--r--LayerManagerCommands/src/LayerSetPositionCommand.cpp (renamed from LayerManagerCommands/src/SetPositionCommand.cpp)34
-rw-r--r--LayerManagerCommands/src/LayerSetRenderOrderCommand.cpp (renamed from LayerManagerCommands/src/SetOrderWithinLayerCommand.cpp)14
-rw-r--r--LayerManagerCommands/src/LayerSetSourceRectangleCommand.cpp (renamed from LayerManagerCommands/src/SetSourceRectangleCommand.cpp)34
-rw-r--r--LayerManagerCommands/src/LayerSetTypeCommand.cpp (renamed from LayerManagerCommands/src/SetLayerTypeCommand.cpp)12
-rw-r--r--LayerManagerCommands/src/LayerSetVisibilityCommand.cpp (renamed from LayerManagerCommands/src/SetVisibilityCommand.cpp)42
-rw-r--r--LayerManagerCommands/src/LayergroupCreateCommand.cpp54
-rw-r--r--LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp57
-rw-r--r--LayerManagerCommands/src/LayergroupRemoveCommand.cpp53
-rw-r--r--LayerManagerCommands/src/LayergroupSetOpacityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/LayergroupSetVisibilityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/RemoveCommand.cpp99
-rw-r--r--LayerManagerCommands/src/ScreenDumpCommand.cpp72
-rw-r--r--LayerManagerCommands/src/ScreenSetRenderOrderCommand.cpp (renamed from LayerManagerCommands/src/SetLayerOrderCommand.cpp)16
-rw-r--r--LayerManagerCommands/src/ScreenShotCommand.cpp132
-rw-r--r--LayerManagerCommands/src/ShaderCreateCommand.cpp (renamed from LayerManagerCommands/src/CreateShaderCommand.cpp)14
-rw-r--r--LayerManagerCommands/src/ShaderDestroyCommand.cpp (renamed from LayerManagerCommands/src/DestroyShaderCommand.cpp)14
-rw-r--r--LayerManagerCommands/src/ShaderSetUniformsCommand.cpp (renamed from LayerManagerCommands/src/SetUniformsCommand.cpp)20
-rw-r--r--LayerManagerCommands/src/SurfaceCreateCommand.cpp70
-rw-r--r--LayerManagerCommands/src/SurfaceDumpCommand.cpp80
-rw-r--r--LayerManagerCommands/src/SurfaceGetDimensionCommand.cpp64
-rw-r--r--LayerManagerCommands/src/SurfaceGetOpacityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/SurfaceGetOrientationCommand.cpp55
-rw-r--r--LayerManagerCommands/src/SurfaceGetPixelformatCommand.cpp (renamed from LayerManagerCommands/src/GetPixelformatCommand.cpp)37
-rw-r--r--LayerManagerCommands/src/SurfaceGetPositionCommand.cpp65
-rw-r--r--LayerManagerCommands/src/SurfaceGetVisibilityCommand.cpp57
-rw-r--r--LayerManagerCommands/src/SurfaceRemoveCommand.cpp53
-rw-r--r--LayerManagerCommands/src/SurfaceSetDestinationRectangleCommand.cpp63
-rw-r--r--LayerManagerCommands/src/SurfaceSetDimensionCommand.cpp57
-rw-r--r--LayerManagerCommands/src/SurfaceSetOpacityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/SurfaceSetOrientationCommand.cpp55
-rw-r--r--LayerManagerCommands/src/SurfaceSetPositionCommand.cpp56
-rw-r--r--LayerManagerCommands/src/SurfaceSetShaderCommand.cpp (renamed from LayerManagerCommands/src/SetShaderCommand.cpp)18
-rw-r--r--LayerManagerCommands/src/SurfaceSetSourceRectangleCommand.cpp62
-rw-r--r--LayerManagerCommands/src/SurfaceSetVisibilityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/SurfacegroupCreateCommand.cpp54
-rw-r--r--LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp57
-rw-r--r--LayerManagerCommands/src/SurfacegroupRemoveCommand.cpp53
-rw-r--r--LayerManagerCommands/src/SurfacegroupSetOpacityCommand.cpp56
-rw-r--r--LayerManagerCommands/src/SurfacegroupSetVisibilityCommand.cpp56
106 files changed, 3305 insertions, 972 deletions
diff --git a/LayerManagerCommands/CMakeLists.txt b/LayerManagerCommands/CMakeLists.txt
index 8501799..22eea97 100644
--- a/LayerManagerCommands/CMakeLists.txt
+++ b/LayerManagerCommands/CMakeLists.txt
@@ -29,7 +29,7 @@ file(GLOB LM_INCLUDES include/*.h)
add_library(LayerManagerCommands SHARED ${LM_SOURCES})
-set(LIBS ${LIBS} LayerManagerUtils)
+set(LIBS ${LIBS} LayerManagerUtils)
target_link_libraries(LayerManagerCommands ${LIBS})
install (TARGETS LayerManagerCommands DESTINATION lib)
diff --git a/LayerManagerCommands/include/LayerCreateCommand.h b/LayerManagerCommands/include/LayerCreateCommand.h
new file mode 100644
index 0000000..c056fde
--- /dev/null
+++ b/LayerManagerCommands/include/LayerCreateCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _LAYERCREATECOMMAND_H_
+#define _LAYERCREATECOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+#include "IScene.h"
+
+class LayerCreateCommand : public BaseCommandSynchronous
+{
+public:
+ LayerCreateCommand(uint OriginalWidth, uint OriginalHeight, uint* idReturn);
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ uint m_originalWidth;
+ uint m_originalHeight;
+ uint* m_idReturn;
+
+ // for unit testing
+ //template <typename nativeHandle_type, typename OriginalWidth_type, typename OriginalHeight_type, typename createType_type, typename pixelformat_type> friend class CreateCommandEqMatcherP5;
+};
+
+
+#endif /* _LAYERCREATECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/ScreenShotCommand.h b/LayerManagerCommands/include/LayerDumpCommand.h
index 78a22b8..0bd4239 100644
--- a/LayerManagerCommands/include/ScreenShotCommand.h
+++ b/LayerManagerCommands/include/LayerDumpCommand.h
@@ -17,17 +17,16 @@
*
****************************************************************************/
-#ifndef _SCREENSHOTCOMMAND_H_
-#define _SCREENSHOTCOMMAND_H_
+#ifndef _LAYERDUMPCOMMAND_H_
+#define _LAYERDUMPCOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ScreenShotType.h"
#include <string>
-class ScreenShotCommand: public BaseCommandSynchronous
+class LayerDumpCommand: public BaseCommandSynchronous
{
public:
- ScreenShotCommand(char* givenfilename, ScreenShotType type = ScreenshotOfDisplay, unsigned int id = 0);
+ LayerDumpCommand(char* givenfilename, unsigned int id = 0);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -35,7 +34,6 @@ public:
private:
std::string m_filename;
const unsigned int m_id;
- const ScreenShotType m_type;
};
-#endif /* _SCREENSHOTCOMMAND_H_ */
+#endif /* _LAYERDUMPCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/GetDimensionCommand.h b/LayerManagerCommands/include/LayerGetDimensionCommand.h
index 7ddfcf1..c2268d2 100644
--- a/LayerManagerCommands/include/GetDimensionCommand.h
+++ b/LayerManagerCommands/include/LayerGetDimensionCommand.h
@@ -17,28 +17,26 @@
*
****************************************************************************/
-#ifndef _GETDIMENSIONCOMMAND_H_
-#define _GETDIMENSIONCOMMAND_H_
+#ifndef _LAYERGETDIMENSIONCOMMAND_H_
+#define _LAYERGETDIMENSIONCOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ObjectType.h"
-class GetDimensionCommand: public BaseCommandSynchronous
+class LayerGetDimensionCommand: public BaseCommandSynchronous
{
public:
- GetDimensionCommand(int id, ObjectType type, unsigned int* widthRet, unsigned int* heightRet);
+ LayerGetDimensionCommand(int id, unsigned int* widthRet, unsigned int* heightRet);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned m_id;
- const ObjectType m_type;
unsigned int* m_pWidth;
unsigned int* m_pHeight;
// for unit testing
- template <typename id_type, typename type_type> friend class GetDimensionCommandEqMatcherP2;
+ //template <typename id_type, typename type_type> friend class GetDimensionCommandEqMatcherP2;
};
-#endif /* _GETDIMENSIONCOMMAND_H_ */
+#endif /* _LAYERGETDIMENSIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/GetOpacityCommand.h b/LayerManagerCommands/include/LayerGetOpacityCommand.h
index c1f8cc5..f560793 100644
--- a/LayerManagerCommands/include/GetOpacityCommand.h
+++ b/LayerManagerCommands/include/LayerGetOpacityCommand.h
@@ -17,28 +17,27 @@
*
****************************************************************************/
-#ifndef _GETOPACITYCOMMAND_H_
-#define _GETOPACITYCOMMAND_H_
+#ifndef _LAYERGETOPACITYCOMMAND_H_
+#define _LAYERGETOPACITYCOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ObjectType.h"
-class GetOpacityCommand : public BaseCommandSynchronous
+
+class LayerGetOpacityCommand : public BaseCommandSynchronous
{
public:
- GetOpacityCommand(int id, ObjectType type, double* returnOpacity);
+ LayerGetOpacityCommand(int id, double* returnOpacity);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned m_id;
- const ObjectType m_type;
double* m_pReturnOpacity;
// for unit testing
- template <typename id_type, typename type_type> friend class GetOpacityCommandEqMatcherP2;
+ //template <typename id_type, typename type_type> friend class GetOpacityCommandEqMatcherP2;
};
-#endif /* _GETOPACITYCOMMAND_H_ */
+#endif /* _LAYERGETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/GetOrientationCommand.h b/LayerManagerCommands/include/LayerGetOrientationCommand.h
index 357a0d5..f804094 100644
--- a/LayerManagerCommands/include/GetOrientationCommand.h
+++ b/LayerManagerCommands/include/LayerGetOrientationCommand.h
@@ -17,26 +17,24 @@
*
****************************************************************************/
-#ifndef _GETORIENTATIONCOMMAND_H_
-#define _GETORIENTATIONCOMMAND_H_
+#ifndef _LAYERGETORIENTATIONCOMMAND_H_
+#define _LAYERGETORIENTATIONCOMMAND_H_
#include "BaseCommandSynchronous.h"
#include "OrientationType.h"
-#include "ObjectType.h"
-class GetOrientationCommand: public BaseCommandSynchronous
+class LayerGetOrientationCommand: public BaseCommandSynchronous
{
public:
- GetOrientationCommand(int id, ObjectType type, OrientationType* orientation);
+ LayerGetOrientationCommand(int id, OrientationType* orientation);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned m_id;
- const ObjectType m_type;
OrientationType* m_pReturnOrientation;
};
-#endif /* _GETORIENTATIONCOMMAND_H_ */
+#endif /* _LAYERGETORIENTATIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/GetPositionCommand.h b/LayerManagerCommands/include/LayerGetPositionCommand.h
index dbc1dfd..981a372 100644
--- a/LayerManagerCommands/include/GetPositionCommand.h
+++ b/LayerManagerCommands/include/LayerGetPositionCommand.h
@@ -17,26 +17,24 @@
*
****************************************************************************/
-#ifndef _GETPOSITIONCOMMAND_H_
-#define _GETPOSITIONCOMMAND_H_
+#ifndef _LAYERGETPOSITIONCOMMAND_H_
+#define _LAYERGETPOSITIONCOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ObjectType.h"
-class GetPositionCommand : public BaseCommandSynchronous
+class LayerGetPositionCommand : public BaseCommandSynchronous
{
public:
- GetPositionCommand(int id, ObjectType type, unsigned int* xRet, unsigned int* yRet);
+ LayerGetPositionCommand(int id, unsigned int* xRet, unsigned int* yRet);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned m_id;
- const ObjectType m_type;
unsigned int* m_pX;
unsigned int* m_pY;
};
-#endif /* _GETPOSITIONCOMMAND_H_ */
+#endif /* _LAYERGETPOSITIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/GetVisibilityCommand.h b/LayerManagerCommands/include/LayerGetVisibilityCommand.h
index 7d6d396..a523644 100644
--- a/LayerManagerCommands/include/GetVisibilityCommand.h
+++ b/LayerManagerCommands/include/LayerGetVisibilityCommand.h
@@ -17,28 +17,26 @@
*
****************************************************************************/
-#ifndef _GETVISIBILITYCOMMAND_H_
-#define _GETVISIBILITYCOMMAND_H_
+#ifndef _LAYERGETVISIBILITYCOMMAND_H_
+#define _LAYERGETVISIBILITYCOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ObjectType.h"
-class GetVisibilityCommand : public BaseCommandSynchronous
+class LayerGetVisibilityCommand : public BaseCommandSynchronous
{
public:
- GetVisibilityCommand(int id, ObjectType type, bool* visibility);
+ LayerGetVisibilityCommand(int id, bool* visibility);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned m_id;
- const ObjectType m_type;
bool* m_pVisibility;
// for unit testing
- template <typename id_type, typename type_type> friend class GetVisibilityCommandEqMatcherP2;
+ //template <typename id_type, typename type_type> friend class GetVisibilityCommandEqMatcherP2;
};
-#endif /* _GETVISIBILITYCOMMAND_H_ */
+#endif /* _LAYERGETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/RemoveCommand.h b/LayerManagerCommands/include/LayerRemoveCommand.h
index de844c7..e94638a 100644
--- a/LayerManagerCommands/include/RemoveCommand.h
+++ b/LayerManagerCommands/include/LayerRemoveCommand.h
@@ -17,26 +17,24 @@
*
****************************************************************************/
-#ifndef _REMOVECOMMAND_H_
-#define _REMOVECOMMAND_H_
+#ifndef _LAYERREMOVECOMMAND_H_
+#define _LAYERREMOVECOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ObjectType.h"
-class RemoveCommand : public BaseCommandSynchronous
+class LayerRemoveCommand : public BaseCommandSynchronous
{
public:
- RemoveCommand(unsigned int objectID, ObjectType typeToRemove);
+ LayerRemoveCommand(unsigned int objectID);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_idToRemove;
- const ObjectType m_typeToRemove;
// for unit testing
- template<typename idToRemove_type, typename typeToRemove_type> friend class RemoveCommandEqMatcherP2;
+ //template<typename idToRemove_type, typename typeToRemove_type> friend class RemoveCommandEqMatcherP2;
};
-#endif /* _REMOVECOMMAND_H_ */
+#endif /* _LAYERREMOVECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetSourceRectangleCommand.h b/LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h
index 73ab6d5..83df6f4 100644
--- a/LayerManagerCommands/include/SetSourceRectangleCommand.h
+++ b/LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h
@@ -17,31 +17,29 @@
*
****************************************************************************/
-#ifndef _SETSOURCERECTANGLECOMMAND_H_
-#define _SETSOURCERECTANGLECOMMAND_H_
+#ifndef _LAYERSETDESTINATIONRECTANGLECOMMAND_H_
+#define _LAYERSETDESTINATIONRECTANGLECOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
-class SetSourceRectangleCommand : public BaseCommandAsynchronous
+class LayerSetDestinationRectangleCommand : public BaseCommandAsynchronous
{
public:
- SetSourceRectangleCommand(int id, ObjectType type, unsigned int x, unsigned int y, unsigned int width, unsigned int height);
+ LayerSetDestinationRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_id;
- const ObjectType m_typeToSet;
const unsigned int m_x;
const unsigned int m_y;
const unsigned int m_width;
const unsigned int m_height;
// for unit testing
- template <typename id_type, typename typeToSet_type, typename x_type, typename y_type, typename width_type, typename height_type> friend class SetSourceRectangleCommandEqMatcherP6;
+ //template <typename id_type, typename typeToSet_type, typename x_type, typename y_type, typename width_type, typename height_type> friend class SetDestinationRectangleCommandEqMatcherP6;
};
-#endif /* _SETSOURCERECTANGLECOMMAND_H_ */
+#endif /* _LAYERSETDESTINATIONRECTANGLECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetDimensionCommand.h b/LayerManagerCommands/include/LayerSetDimensionCommand.h
index 9d21faa..29db225 100644
--- a/LayerManagerCommands/include/SetDimensionCommand.h
+++ b/LayerManagerCommands/include/LayerSetDimensionCommand.h
@@ -17,29 +17,27 @@
*
****************************************************************************/
-#ifndef _SETDIMENSIONCOMMAND_H_
-#define _SETDIMENSIONCOMMAND_H_
+#ifndef _LAYERSETDIMENSIONCOMMAND_H_
+#define _LAYERSETDIMENSIONCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
-class SetDimensionCommand : public BaseCommandAsynchronous
+class LayerSetDimensionCommand : public BaseCommandAsynchronous
{
public:
- SetDimensionCommand(int id, ObjectType typeToSetOn, unsigned int width,unsigned int height);
+ LayerSetDimensionCommand(int id, unsigned int width,unsigned int height);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_id;
- const ObjectType m_typeToSet;
const unsigned int m_width;
const unsigned int m_height;
// for unit testing
- template <typename id_type, typename typeToSet_type, typename width_type, typename height_type> friend class SetDimensionCommandEqMatcherP4;
+ //template <typename id_type, typename typeToSet_type, typename width_type, typename height_type> friend class SetDimensionCommandEqMatcherP4;
};
-#endif /* _SETDIMENSIONCOMMAND_H_ */
+#endif /* _LAYERSETDIMENSIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetOpacityCommand.h b/LayerManagerCommands/include/LayerSetOpacityCommand.h
index 82c58b1..bc1fc3a 100644
--- a/LayerManagerCommands/include/SetOpacityCommand.h
+++ b/LayerManagerCommands/include/LayerSetOpacityCommand.h
@@ -17,28 +17,26 @@
*
****************************************************************************/
-#ifndef _SETOPACITYCOMMAND_H_
-#define _SETOPACITYCOMMAND_H_
+#ifndef _LAYERSETOPACITYCOMMAND_H_
+#define _LAYERSETOPACITYCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
-class SetOpacityCommand : public BaseCommandAsynchronous
+class LayerSetOpacityCommand : public BaseCommandAsynchronous
{
public:
- SetOpacityCommand(unsigned int id, ObjectType type, double Opacity);
+ LayerSetOpacityCommand(unsigned int id, double Opacity);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_id;
- const ObjectType m_type;
const double m_opacity;
// for unit testing
- template <typename id_type, typename type_type, typename Opacity_type> friend class SetOpacityCommandEqMatcherP3;
+ //template <typename id_type, typename type_type, typename Opacity_type> friend class SetOpacityCommandEqMatcherP3;
};
-#endif /* _SETOPACITYCOMMAND_H_ */
+#endif /* _LAYERSETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetOrientationCommand.h b/LayerManagerCommands/include/LayerSetOrientationCommand.h
index 95ebcbc..a53febe 100644
--- a/LayerManagerCommands/include/SetOrientationCommand.h
+++ b/LayerManagerCommands/include/LayerSetOrientationCommand.h
@@ -17,29 +17,27 @@
*
****************************************************************************/
-#ifndef _SETORIENTATIONCOMMAND_H_
-#define _SETORIENTATIONCOMMAND_H_
+#ifndef _LAYERSETORIENTATIONCOMMAND_H_
+#define _LAYERSETORIENTATIONCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
#include "OrientationType.h"
-class SetOrientationCommand : public BaseCommandAsynchronous
+class LayerSetOrientationCommand : public BaseCommandAsynchronous
{
public:
- SetOrientationCommand(unsigned int id, ObjectType type, OrientationType Orientation);
+ LayerSetOrientationCommand(unsigned int id, OrientationType Orientation);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_id;
- const ObjectType m_type;
const OrientationType m_orientation;
// for unit testing
- template <typename id_type, typename type_type, typename Orientation_type> friend class SetOrientationCommandEqMatcherP3;
+ //template <typename id_type, typename type_type, typename Orientation_type> friend class SetOrientationCommandEqMatcherP3;
};
-#endif /* _SETORIENTATIONCOMMAND_H_ */
+#endif /* _LAYERSETORIENTATIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetPositionCommand.h b/LayerManagerCommands/include/LayerSetPositionCommand.h
index 93a8a22..cfdfee5 100644
--- a/LayerManagerCommands/include/SetPositionCommand.h
+++ b/LayerManagerCommands/include/LayerSetPositionCommand.h
@@ -17,29 +17,27 @@
*
****************************************************************************/
-#ifndef _SETPOSITIONCOMMAND_H_
-#define _SETPOSITIONCOMMAND_H_
+#ifndef _LAYERSETPOSITIONCOMMAND_H_
+#define _LAYERSETPOSITIONCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
-class SetPositionCommand : public BaseCommandAsynchronous
+class LayerSetPositionCommand : public BaseCommandAsynchronous
{
public:
- SetPositionCommand(unsigned int id, ObjectType typeToSetOn, unsigned int x, unsigned int y);
+ LayerSetPositionCommand(unsigned int id, unsigned int x, unsigned int y);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_id;
- const ObjectType m_typeToSet;
const unsigned int m_x;
const unsigned int m_y;
// for unit testing
- template <typename id_type, typename typeToSet_type, typename x_type, typename y_type> friend class SetPositionCommandEqMatcherP4;
+ //template <typename id_type, typename typeToSet_type, typename x_type, typename y_type> friend class SetPositionCommandEqMatcherP4;
};
-#endif /* _SETPOSITIONCOMMAND_H_ */
+#endif /* _LAYERSETPOSITIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetOrderWithinLayerCommand.h b/LayerManagerCommands/include/LayerSetRenderOrderCommand.h
index 68a4144..afa89dc 100644
--- a/LayerManagerCommands/include/SetOrderWithinLayerCommand.h
+++ b/LayerManagerCommands/include/LayerSetRenderOrderCommand.h
@@ -17,15 +17,15 @@
*
****************************************************************************/
-#ifndef _SETORDERWITHINLAYERCOMMAND_H_
-#define _SETORDERWITHINLAYERCOMMAND_H_
+#ifndef _LAYERSETRENDERORDERCOMMAND_H_
+#define _LAYERSETRENDERORDERCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-class SetOrderWithinLayerCommand : public BaseCommandAsynchronous
+class LayerSetRenderOrderCommand : public BaseCommandAsynchronous
{
public:
- SetOrderWithinLayerCommand(unsigned int layerid,unsigned int* array,unsigned int length);
+ LayerSetRenderOrderCommand(unsigned int layerid,unsigned int* array,unsigned int length);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -37,4 +37,4 @@ private:
};
-#endif /* _SETORDERWITHINLAYERCOMMAND_H_ */
+#endif /* _LAYERSETRENDERORDERCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetDestinationRectangleCommand.h b/LayerManagerCommands/include/LayerSetSourceRectangleCommand.h
index 6b479c8..bcdf84a 100644
--- a/LayerManagerCommands/include/SetDestinationRectangleCommand.h
+++ b/LayerManagerCommands/include/LayerSetSourceRectangleCommand.h
@@ -17,31 +17,29 @@
*
****************************************************************************/
-#ifndef _SETDESTINATIONRECTANGLECOMMAND_H_
-#define _SETDESTINATIONRECTANGLECOMMAND_H_
+#ifndef _LAYERSETSOURCERECTANGLECOMMAND_H_
+#define _LAYERSETSOURCERECTANGLECOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
-class SetDestinationRectangleCommand : public BaseCommandAsynchronous
+class LayerSetSourceRectangleCommand : public BaseCommandAsynchronous
{
public:
- SetDestinationRectangleCommand(int id, ObjectType typeToSetOn, unsigned int x, unsigned int y, unsigned int width, unsigned int height);
+ LayerSetSourceRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_id;
- const ObjectType m_typeToSet;
const unsigned int m_x;
const unsigned int m_y;
const unsigned int m_width;
const unsigned int m_height;
// for unit testing
- template <typename id_type, typename typeToSet_type, typename x_type, typename y_type, typename width_type, typename height_type> friend class SetDestinationRectangleCommandEqMatcherP6;
+ //template <typename id_type, typename typeToSet_type, typename x_type, typename y_type, typename width_type, typename height_type> friend class SetSourceRectangleCommandEqMatcherP6;
};
-#endif /* _SETDESTINATIONRECTANGLECOMMAND_H_ */
+#endif /* _LAYERSETSOURCERECTANGLECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetLayerTypeCommand.h b/LayerManagerCommands/include/LayerSetTypeCommand.h
index 9767886..2182e5f 100644
--- a/LayerManagerCommands/include/SetLayerTypeCommand.h
+++ b/LayerManagerCommands/include/LayerSetTypeCommand.h
@@ -17,16 +17,16 @@
*
****************************************************************************/
-#ifndef _SETLAYERTYPECOMMAND_H_
-#define _SETLAYERTYPECOMMAND_H_
+#ifndef _LAYERSETTYPECOMMAND_H_
+#define _LAYERSETTYPECOMMAND_H_
#include "BaseCommandAsynchronous.h"
#include "LayerType.h"
-class SetLayerTypeCommand : public BaseCommandAsynchronous
+class LayerSetTypeCommand : public BaseCommandAsynchronous
{
public:
- SetLayerTypeCommand(const unsigned int givenid, LayerType layertype);
+ LayerSetTypeCommand(const unsigned int givenid, LayerType layertype);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -37,4 +37,4 @@ private:
};
-#endif /* _SETLAYERTYPECOMMAND_H_ */
+#endif /* _LAYERSETTYPECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetVisibilityCommand.h b/LayerManagerCommands/include/LayerSetVisibilityCommand.h
index 096dc21..2ccc3db 100644
--- a/LayerManagerCommands/include/SetVisibilityCommand.h
+++ b/LayerManagerCommands/include/LayerSetVisibilityCommand.h
@@ -17,28 +17,26 @@
*
****************************************************************************/
-#ifndef _SETVISIBILITYCOMMAND_H_
-#define _SETVISIBILITYCOMMAND_H_
+#ifndef _LAYERSETVISIBILITYCOMMAND_H_
+#define _LAYERSETVISIBILITYCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-#include "ObjectType.h"
-class SetVisibilityCommand : public BaseCommandAsynchronous
+class LayerSetVisibilityCommand : public BaseCommandAsynchronous
{
public:
- SetVisibilityCommand(const unsigned int givenid, ObjectType Objecttype, bool newvisibility);
+ LayerSetVisibilityCommand(const unsigned int givenid, bool newvisibility);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned int m_idtoSet;
- const ObjectType m_otype;
const bool m_visibility;
// for unit testing
- template <typename id_type, typename otype_type, typename visibility_type> friend class SetVisibilityCommandEqMatcherP3;
+ //template <typename id_type, typename otype_type, typename visibility_type> friend class SetVisibilityCommandEqMatcherP3;
};
-#endif /* _SETVISIBILITYCOMMAND_H_ */
+#endif /* _LAYERSETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupCreateCommand.h b/LayerManagerCommands/include/LayergroupCreateCommand.h
new file mode 100644
index 0000000..aeb0eb2
--- /dev/null
+++ b/LayerManagerCommands/include/LayergroupCreateCommand.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+*
+* 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 "BaseCommandSynchronous.h"
+#include "IScene.h"
+
+class LayergroupCreateCommand : public BaseCommandSynchronous
+{
+public:
+ LayergroupCreateCommand(uint* idReturn);
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ uint* m_idReturn;
+
+ // for unit testing
+ //template <typename nativeHandle_type, typename OriginalWidth_type, typename OriginalHeight_type, typename createType_type, typename pixelformat_type> friend class CreateCommandEqMatcherP5;
+};
+
+
+#endif /* _CREATECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupGetOpacityCommand.h b/LayerManagerCommands/include/LayergroupGetOpacityCommand.h
new file mode 100644
index 0000000..766a9ce
--- /dev/null
+++ b/LayerManagerCommands/include/LayergroupGetOpacityCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _LAYERGROUPGETOPACITYCOMMAND_H_
+#define _LAYERGROUPGETOPACITYCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+
+class LayergroupGetOpacityCommand : public BaseCommandSynchronous
+{
+public:
+ LayergroupGetOpacityCommand(int id, double* returnOpacity);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ double* m_pReturnOpacity;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetOpacityCommandEqMatcherP2;
+};
+
+
+#endif /* _LAYERGROUPGETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h b/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h
new file mode 100644
index 0000000..b7cad69
--- /dev/null
+++ b/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 _LAYERGROUPGETVISIBILITYCOMMAND_H_
+#define _LAYERGROUPGETVISIBILITYCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+class LayergroupGetVisibilityCommand : public BaseCommandSynchronous
+{
+public:
+ LayergroupGetVisibilityCommand(int id, bool* visibility);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ bool* m_pVisibility;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetVisibilityCommandEqMatcherP2;
+};
+
+
+#endif /* _LAYERGROUPGETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupRemoveCommand.h b/LayerManagerCommands/include/LayergroupRemoveCommand.h
new file mode 100644
index 0000000..1695896
--- /dev/null
+++ b/LayerManagerCommands/include/LayergroupRemoveCommand.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+*
+* 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 "BaseCommandSynchronous.h"
+
+class LayergroupRemoveCommand : public BaseCommandSynchronous
+{
+public:
+ LayergroupRemoveCommand(unsigned int objectID);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_idToRemove;
+
+ // for unit testing
+ //template<typename idToRemove_type, typename typeToRemove_type> friend class RemoveCommandEqMatcherP2;
+};
+
+#endif /* _LAYERGROUPREMOVECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupSetOpacityCommand.h b/LayerManagerCommands/include/LayergroupSetOpacityCommand.h
new file mode 100644
index 0000000..6ff0f76
--- /dev/null
+++ b/LayerManagerCommands/include/LayergroupSetOpacityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 "BaseCommandAsynchronous.h"
+
+class LayergroupSetOpacityCommand : public BaseCommandAsynchronous
+{
+public:
+ LayergroupSetOpacityCommand(unsigned int id, double Opacity);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const double m_opacity;
+
+ // for unit testing
+ //template <typename id_type, typename type_type, typename Opacity_type> friend class SetOpacityCommandEqMatcherP3;
+};
+
+
+#endif /* _LAYERGROUPSETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h b/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h
new file mode 100644
index 0000000..0fee0f5
--- /dev/null
+++ b/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 "BaseCommandAsynchronous.h"
+
+class LayergroupSetVisibilityCommand : public BaseCommandAsynchronous
+{
+public:
+ LayergroupSetVisibilityCommand(const unsigned int givenid, bool newvisibility);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_idtoSet;
+ const bool m_visibility;
+
+ // for unit testing
+ //template <typename id_type, typename otype_type, typename visibility_type> friend class SetVisibilityCommandEqMatcherP3;
+};
+
+
+#endif /* _LAYERGROUPSETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/ScreenDumpCommand.h b/LayerManagerCommands/include/ScreenDumpCommand.h
new file mode 100644
index 0000000..222f7cf
--- /dev/null
+++ b/LayerManagerCommands/include/ScreenDumpCommand.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ *
+ * 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 _SCREENDUMPCOMMAND_H_
+#define _SCREENDUMPCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+#include <string>
+
+class ScreenDumpCommand: public BaseCommandSynchronous
+{
+public:
+ ScreenDumpCommand(char* givenfilename, unsigned int id = 0);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ std::string m_filename;
+ const unsigned int m_id;
+};
+
+#endif /* _SCREENDUMPCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetLayerOrderCommand.h b/LayerManagerCommands/include/ScreenSetRenderOrderCommand.h
index 7a3c23f..f685b04 100644
--- a/LayerManagerCommands/include/SetLayerOrderCommand.h
+++ b/LayerManagerCommands/include/ScreenSetRenderOrderCommand.h
@@ -17,15 +17,15 @@
*
****************************************************************************/
-#ifndef _SETLAYERORDERCOMMAND_H_
-#define _SETLAYERORDERCOMMAND_H_
+#ifndef _SCREENSETRENDERORDERCOMMAND_H_
+#define _SCREENSETRENDERORDERCOMMAND_H_
#include "BaseCommandAsynchronous.h"
-class SetLayerOrderCommand: public BaseCommandAsynchronous
+class ScreenSetRenderOrderCommand: public BaseCommandAsynchronous
{
public:
- SetLayerOrderCommand(unsigned int* array, unsigned int length);
+ ScreenSetRenderOrderCommand(unsigned int* array, unsigned int length);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -35,4 +35,4 @@ private:
const unsigned int m_length;
};
-#endif /* _SETLAYERORDERCOMMAND_H_ */
+#endif /* _SCREENSETRENDERORDERCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/CreateShaderCommand.h b/LayerManagerCommands/include/ShaderCreateCommand.h
index 21b1769..e587742 100644
--- a/LayerManagerCommands/include/CreateShaderCommand.h
+++ b/LayerManagerCommands/include/ShaderCreateCommand.h
@@ -17,17 +17,17 @@
*
****************************************************************************/
-#ifndef _CREATESHADERCOMMAND_H_
-#define _CREATESHADERCOMMAND_H_
+#ifndef _SHADERCREATECOMMAND_H_
+#define _SHADERCREATECOMMAND_H_
#include "BaseCommandSynchronous.h"
#include "Shader.h"
#include <string>
-class CreateShaderCommand : public BaseCommandSynchronous
+class ShaderCreateCommand : public BaseCommandSynchronous
{
public:
- CreateShaderCommand(const std::string& vertName, const std::string& fragName, unsigned int* id);
+ ShaderCreateCommand(const std::string& vertName, const std::string& fragName, unsigned int* id);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -41,4 +41,4 @@ private:
unsigned int* m_returnID;
};
-#endif /* _CREATESHADERCOMMAND_H_ */
+#endif /* _SHADERCREATECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/DestroyShaderCommand.h b/LayerManagerCommands/include/ShaderDestroyCommand.h
index f0e8f49..d5de157 100644
--- a/LayerManagerCommands/include/DestroyShaderCommand.h
+++ b/LayerManagerCommands/include/ShaderDestroyCommand.h
@@ -17,8 +17,8 @@
*
****************************************************************************/
-#ifndef _DESTROYSHADERCOMMAND_H_
-#define _DESTROYSHADERCOMMAND_H_
+#ifndef _SHADERDESTROYCOMMAND_H_
+#define _SHADERDESTROYCOMMAND_H_
#include "BaseCommandSynchronous.h"
#include "GraphicalObject.h"
@@ -27,10 +27,10 @@
#include "SurfaceMap.h"
-class DestroyShaderCommand : public BaseCommandSynchronous
+class ShaderDestroyCommand : public BaseCommandSynchronous
{
public:
- DestroyShaderCommand(unsigned int shaderid);
+ ShaderDestroyCommand(unsigned int shaderid);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -47,4 +47,4 @@ private:
const unsigned int m_id;
};
-#endif /* _DESTROYSHADERCOMMAND_H_ */
+#endif /* _SHADERDESTROYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetUniformsCommand.h b/LayerManagerCommands/include/ShaderSetUniformsCommand.h
index 450821e..d554fac 100644
--- a/LayerManagerCommands/include/SetUniformsCommand.h
+++ b/LayerManagerCommands/include/ShaderSetUniformsCommand.h
@@ -16,17 +16,17 @@
* limitations under the License.
*
****************************************************************************/
-#ifndef _SETUNIFORMSCOMMAND_H_
-#define _SETUNIFORMSCOMMAND_H_
+#ifndef _SHADERSETUNIFORMSCOMMAND_H_
+#define _SHADERSETUNIFORMSCOMMAND_H_
#include "BaseCommandSynchronous.h"
#include <string>
#include <vector>
-class SetUniformsCommand : public BaseCommandSynchronous
+class ShaderSetUniformsCommand : public BaseCommandSynchronous
{
public:
- SetUniformsCommand(unsigned int shaderid, const std::vector<std::string>& uniforms);
+ ShaderSetUniformsCommand(unsigned int shaderid, const std::vector<std::string>& uniforms);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -39,6 +39,6 @@ private:
const std::vector<std::string> m_uniforms;
};
-#endif /* _SETUNIFORMSCOMMAND_H_ */
+#endif /* _SHADERSETUNIFORMSCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/CreateCommand.h b/LayerManagerCommands/include/SurfaceCreateCommand.h
index 3700c33..05e5912 100644
--- a/LayerManagerCommands/include/CreateCommand.h
+++ b/LayerManagerCommands/include/SurfaceCreateCommand.h
@@ -17,29 +17,21 @@
*
****************************************************************************/
-#ifndef _CREATECOMMAND_H_
-#define _CREATECOMMAND_H_
+#ifndef _SURFACECREATECOMMAND_H_
+#define _SURFACECREATECOMMAND_H_
#include "BaseCommandSynchronous.h"
#include "PixelFormat.h"
-#include "ObjectType.h"
#include "IScene.h"
-class CreateCommand : public BaseCommandSynchronous
+class SurfaceCreateCommand : public BaseCommandSynchronous
{
public:
- CreateCommand(unsigned int handle, ObjectType createType, PixelFormat pixelformat, uint OriginalWidth, uint OriginalHeight, uint* idReturn);
+ SurfaceCreateCommand(unsigned int handle, PixelFormat pixelformat, uint OriginalWidth, uint OriginalHeight, uint* idReturn);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
- bool createSurface(IScene& scene);
- bool createLayer(IScene& scene);
- bool createSurfaceGroup(IScene& scene);
- bool createLayerGroup(IScene& scene);
-
-private:
- const ObjectType m_createType;
const unsigned int m_nativeHandle;
const PixelFormat m_pixelformat;
uint m_originalWidth;
@@ -47,8 +39,8 @@ private:
uint* m_idReturn;
// for unit testing
- template <typename nativeHandle_type, typename OriginalWidth_type, typename OriginalHeight_type, typename createType_type, typename pixelformat_type> friend class CreateCommandEqMatcherP5;
+ //template <typename nativeHandle_type, typename OriginalWidth_type, typename OriginalHeight_type, typename createType_type, typename pixelformat_type> friend class CreateCommandEqMatcherP5;
};
-#endif /* _CREATECOMMAND_H_ */
+#endif /* _SURFACECREATECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceDumpCommand.h b/LayerManagerCommands/include/SurfaceDumpCommand.h
new file mode 100644
index 0000000..b460e4c
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceDumpCommand.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ *
+ * 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 _SURFACEDUMPCOMMAND_H_
+#define _SURFACEDUMPCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+#include <string>
+
+class SurfaceDumpCommand: public BaseCommandSynchronous
+{
+public:
+ SurfaceDumpCommand(char* givenfilename, unsigned int id = 0);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ std::string m_filename;
+ const unsigned int m_id;
+};
+
+#endif /* _SURFACEDUMPCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceGetDimensionCommand.h b/LayerManagerCommands/include/SurfaceGetDimensionCommand.h
new file mode 100644
index 0000000..99b8e04
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceGetDimensionCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ *
+ * 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 _SURFACEGETDIMENSIONCOMMAND_H_
+#define _SURFACEGETDIMENSIONCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+class SurfaceGetDimensionCommand: public BaseCommandSynchronous
+{
+public:
+ SurfaceGetDimensionCommand(int id, unsigned int* widthRet, unsigned int* heightRet);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ unsigned int* m_pWidth;
+ unsigned int* m_pHeight;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetDimensionCommandEqMatcherP2;
+};
+
+#endif /* _SURFACEGETDIMENSIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceGetOpacityCommand.h b/LayerManagerCommands/include/SurfaceGetOpacityCommand.h
new file mode 100644
index 0000000..9691609
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceGetOpacityCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _SURFACEGETOPACITYCOMMAND_H_
+#define _SURFACEGETOPACITYCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+
+class SurfaceGetOpacityCommand : public BaseCommandSynchronous
+{
+public:
+ SurfaceGetOpacityCommand(int id, double* returnOpacity);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ double* m_pReturnOpacity;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetOpacityCommandEqMatcherP2;
+};
+
+
+#endif /* _SURFACEGETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceGetOrientationCommand.h b/LayerManagerCommands/include/SurfaceGetOrientationCommand.h
new file mode 100644
index 0000000..9d3bdf8
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceGetOrientationCommand.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+ *
+ * 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 _SURFACEGETORIENTATIONCOMMAND_H_
+#define _SURFACEGETORIENTATIONCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+#include "OrientationType.h"
+
+
+class SurfaceGetOrientationCommand: public BaseCommandSynchronous
+{
+public:
+ SurfaceGetOrientationCommand(int id, OrientationType* orientation);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ OrientationType* m_pReturnOrientation;
+};
+
+#endif /* _SURFACEGETORIENTATIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/GetPixelformatCommand.h b/LayerManagerCommands/include/SurfaceGetPixelformatCommand.h
index f312127..ca99536 100644
--- a/LayerManagerCommands/include/GetPixelformatCommand.h
+++ b/LayerManagerCommands/include/SurfaceGetPixelformatCommand.h
@@ -17,28 +17,26 @@
*
****************************************************************************/
-#ifndef _GETPIXELFORMATCOMMAND_H_
-#define _GETPIXELFORMATCOMMAND_H_
+#ifndef _SURFACEGETPIXELFORMATCOMMAND_H_
+#define _SURFACEGETPIXELFORMATCOMMAND_H_
#include "BaseCommandSynchronous.h"
-#include "ObjectType.h"
#include "PixelFormat.h"
-class GetPixelformatCommand : public BaseCommandSynchronous
+class SurfaceGetPixelformatCommand : public BaseCommandSynchronous
{
public:
- GetPixelformatCommand(int id, ObjectType type, PixelFormat* f);
+ SurfaceGetPixelformatCommand(int id, PixelFormat* f);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
private:
const unsigned m_id;
- const ObjectType m_type;
PixelFormat* m_pFormatreturn;
// for unit testing
- template <typename id_type, typename type_type> friend class GetPixelformatCommandEqMatcherP2;
+ //template <typename id_type, typename type_type> friend class GetPixelformatCommandEqMatcherP2;
};
-#endif /* _GETPIXELFORMATCOMMAND_H_ */
+#endif /* _SURFACEGETPIXELFORMATCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceGetPositionCommand.h b/LayerManagerCommands/include/SurfaceGetPositionCommand.h
new file mode 100644
index 0000000..3e4c44a
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceGetPositionCommand.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+*
+* 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 _SURFACEGETPOSITIONCOMMAND_H_
+#define _SURFACEGETPOSITIONCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+class SurfaceGetPositionCommand : public BaseCommandSynchronous
+{
+public:
+ SurfaceGetPositionCommand(int id, unsigned int* xRet, unsigned int* yRet);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ unsigned int* m_pX;
+ unsigned int* m_pY;
+};
+
+
+#endif /* _SURFACEGETPOSITIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h b/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h
new file mode 100644
index 0000000..030bdf8
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 _SURFACEGETVISIBILITYCOMMAND_H_
+#define _SURFACEGETVISIBILITYCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+class SurfaceGetVisibilityCommand : public BaseCommandSynchronous
+{
+public:
+ SurfaceGetVisibilityCommand(int id, bool* visibility);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ bool* m_pVisibility;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetVisibilityCommandEqMatcherP2;
+};
+
+
+#endif /* _SURFACEGETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceRemoveCommand.h b/LayerManagerCommands/include/SurfaceRemoveCommand.h
new file mode 100644
index 0000000..8a727d1
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceRemoveCommand.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+*
+* 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 _SURFACEREMOVECOMMAND_H_
+#define _SURFACEREMOVECOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+class SurfaceRemoveCommand : public BaseCommandSynchronous
+{
+public:
+ SurfaceRemoveCommand(unsigned int objectID);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_idToRemove;
+
+ // for unit testing
+ //template<typename idToRemove_type, typename typeToRemove_type> friend class RemoveCommandEqMatcherP2;
+};
+
+#endif /* _SURFACEREMOVECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h b/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h
new file mode 100644
index 0000000..eb6859e
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+*
+* 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 _SURFACESETDESTINATIONRECTANGLECOMMAND_H_
+#define _SURFACESETDESTINATIONRECTANGLECOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+
+class SurfaceSetDestinationRectangleCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetDestinationRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const unsigned int m_x;
+ const unsigned int m_y;
+ const unsigned int m_width;
+ const unsigned int m_height;
+
+ // for unit testing
+ //template <typename id_type, typename typeToSet_type, typename x_type, typename y_type, typename width_type, typename height_type> friend class SetDestinationRectangleCommandEqMatcherP6;
+};
+
+
+#endif /* _SURFACESETDESTINATIONRECTANGLECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetDimensionCommand.h b/LayerManagerCommands/include/SurfaceSetDimensionCommand.h
new file mode 100644
index 0000000..7949fb3
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetDimensionCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _SURFACESETDIMENSIONCOMMAND_H_
+#define _SURFACESETDIMENSIONCOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+
+class SurfaceSetDimensionCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetDimensionCommand(int id, unsigned int width,unsigned int height);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const unsigned int m_width;
+ const unsigned int m_height;
+
+ // for unit testing
+ //template <typename id_type, typename typeToSet_type, typename width_type, typename height_type> friend class SetDimensionCommandEqMatcherP4;
+};
+
+
+#endif /* _SURFACESETDIMENSIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetOpacityCommand.h b/LayerManagerCommands/include/SurfaceSetOpacityCommand.h
new file mode 100644
index 0000000..f6cd8ea
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetOpacityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 _SURFACESETOPACITYCOMMAND_H_
+#define _SURFACESETOPACITYCOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+
+class SurfaceSetOpacityCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetOpacityCommand(unsigned int id, double Opacity);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const double m_opacity;
+
+ // for unit testing
+ //template <typename id_type, typename type_type, typename Opacity_type> friend class SetOpacityCommandEqMatcherP3;
+};
+
+
+#endif /* _SURFACESETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetOrientationCommand.h b/LayerManagerCommands/include/SurfaceSetOrientationCommand.h
new file mode 100644
index 0000000..9e0a17b
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetOrientationCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _SURFACESETORIENTATIONCOMMAND_H_
+#define _SURFACESETORIENTATIONCOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+#include "OrientationType.h"
+
+class SurfaceSetOrientationCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetOrientationCommand(unsigned int id, OrientationType Orientation);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const OrientationType m_orientation;
+
+ // for unit testing
+ //template <typename id_type, typename type_type, typename Orientation_type> friend class SetOrientationCommandEqMatcherP3;
+};
+
+
+#endif /* _SURFACESETORIENTATIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetPositionCommand.h b/LayerManagerCommands/include/SurfaceSetPositionCommand.h
new file mode 100644
index 0000000..30e7d76
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetPositionCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _SURFACESETPOSITIONCOMMAND_H_
+#define _SURFACESETPOSITIONCOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+
+class SurfaceSetPositionCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetPositionCommand(unsigned int id, unsigned int x, unsigned int y);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const unsigned int m_x;
+ const unsigned int m_y;
+
+ // for unit testing
+ //template <typename id_type, typename typeToSet_type, typename x_type, typename y_type> friend class SetPositionCommandEqMatcherP4;
+};
+
+
+#endif /* _SURFACESETPOSITIONCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SetShaderCommand.h b/LayerManagerCommands/include/SurfaceSetShaderCommand.h
index 0a8885d..009ec6a 100644
--- a/LayerManagerCommands/include/SetShaderCommand.h
+++ b/LayerManagerCommands/include/SurfaceSetShaderCommand.h
@@ -17,15 +17,15 @@
*
****************************************************************************/
-#ifndef _SETSHADERCOMMAND_H_
-#define _SETSHADERCOMMAND_H_
+#ifndef _SURFACESETSHADERCOMMAND_H_
+#define _SURFACESETSHADERCOMMAND_H_
#include "BaseCommandSynchronous.h"
-class SetShaderCommand : public BaseCommandSynchronous
+class SurfaceSetShaderCommand : public BaseCommandSynchronous
{
public:
- SetShaderCommand(unsigned int id,unsigned int shaderid);
+ SurfaceSetShaderCommand(unsigned int id,unsigned int shaderid);
virtual ExecutionResult execute(ICommandExecutor* executor);
virtual const std::string getString();
@@ -38,5 +38,5 @@ private:
const unsigned int m_shaderid;
};
-#endif /* _SETSHADERCOMMAND_H_ */
+#endif /* _SURFACESETSHADERCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h b/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h
new file mode 100644
index 0000000..b659eb6
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+*
+* 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 _SURFACESETSOURCERECTANGLECOMMAND_H_
+#define _SURFACESETSOURCERECTANGLECOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+
+class SurfaceSetSourceRectangleCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetSourceRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const unsigned int m_x;
+ const unsigned int m_y;
+ const unsigned int m_width;
+ const unsigned int m_height;
+
+ // for unit testing
+ //template <typename id_type, typename typeToSet_type, typename x_type, typename y_type, typename width_type, typename height_type> friend class SetSourceRectangleCommandEqMatcherP6;
+};
+
+
+#endif /* _SURFACESETSOURCERECTANGLECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h b/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h
new file mode 100644
index 0000000..144d7c4
--- /dev/null
+++ b/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 _SURFACESETVISIBILITYCOMMAND_H_
+#define _SURFACESETVISIBILITYCOMMAND_H_
+
+#include "BaseCommandAsynchronous.h"
+
+class SurfaceSetVisibilityCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfaceSetVisibilityCommand(const unsigned int givenid, bool newvisibility);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_idtoSet;
+ const bool m_visibility;
+
+ // for unit testing
+ //template <typename id_type, typename otype_type, typename visibility_type> friend class SetVisibilityCommandEqMatcherP3;
+};
+
+
+#endif /* _SURFACESETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupCreateCommand.h b/LayerManagerCommands/include/SurfacegroupCreateCommand.h
new file mode 100644
index 0000000..b4dcda6
--- /dev/null
+++ b/LayerManagerCommands/include/SurfacegroupCreateCommand.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+*
+* 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 "BaseCommandSynchronous.h"
+#include "IScene.h"
+
+class SurfacegroupCreateCommand : public BaseCommandSynchronous
+{
+public:
+ SurfacegroupCreateCommand(uint* idReturn);
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ uint* m_idReturn;
+
+ // for unit testing
+ //template <typename nativeHandle_type, typename OriginalWidth_type, typename OriginalHeight_type, typename createType_type, typename pixelformat_type> friend class CreateCommandEqMatcherP5;
+};
+
+
+#endif /* _SURFACEGROUPCREATECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h b/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h
new file mode 100644
index 0000000..300a85f
--- /dev/null
+++ b/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+*
+* 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 _SURFACEGROUPGETOPACITYCOMMAND_H_
+#define _SURFACEGROUPGETOPACITYCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+
+class SurfacegroupGetOpacityCommand : public BaseCommandSynchronous
+{
+public:
+ SurfacegroupGetOpacityCommand(int id, double* returnOpacity);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ double* m_pReturnOpacity;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetOpacityCommandEqMatcherP2;
+};
+
+
+#endif /* _SURFACEGROUPGETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h b/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h
new file mode 100644
index 0000000..50d3f34
--- /dev/null
+++ b/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 _SURFACEGROUPGETVISIBILITYCOMMAND_H_
+#define _SURFACEGROUPGETVISIBILITYCOMMAND_H_
+
+#include "BaseCommandSynchronous.h"
+
+class SurfacegroupGetVisibilityCommand : public BaseCommandSynchronous
+{
+public:
+ SurfacegroupGetVisibilityCommand(int id, bool* visibility);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned m_id;
+ bool* m_pVisibility;
+
+ // for unit testing
+ //template <typename id_type, typename type_type> friend class GetVisibilityCommandEqMatcherP2;
+};
+
+
+#endif /* _SURFACEGROUPGETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupRemoveCommand.h b/LayerManagerCommands/include/SurfacegroupRemoveCommand.h
new file mode 100644
index 0000000..16934fe
--- /dev/null
+++ b/LayerManagerCommands/include/SurfacegroupRemoveCommand.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+*
+* 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 "BaseCommandSynchronous.h"
+
+class SurfacegroupRemoveCommand : public BaseCommandSynchronous
+{
+public:
+ SurfacegroupRemoveCommand(unsigned int objectID);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_idToRemove;
+
+ // for unit testing
+ //template<typename idToRemove_type, typename typeToRemove_type> friend class RemoveCommandEqMatcherP2;
+};
+
+#endif /* _SURFACEGROUPREMOVECOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h b/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h
new file mode 100644
index 0000000..cc39ed7
--- /dev/null
+++ b/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 "BaseCommandAsynchronous.h"
+
+class SurfacegroupSetOpacityCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfacegroupSetOpacityCommand(unsigned int id, double Opacity);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_id;
+ const double m_opacity;
+
+ // for unit testing
+ //template <typename id_type, typename type_type, typename Opacity_type> friend class SetOpacityCommandEqMatcherP3;
+};
+
+
+#endif /* _SURFACEGROUPSETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h b/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h
new file mode 100644
index 0000000..f3d2608
--- /dev/null
+++ b/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+*
+* 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 "BaseCommandAsynchronous.h"
+
+class SurfacegroupSetVisibilityCommand : public BaseCommandAsynchronous
+{
+public:
+ SurfacegroupSetVisibilityCommand(const unsigned int givenid, bool newvisibility);
+
+ virtual ExecutionResult execute(ICommandExecutor* executor);
+ virtual const std::string getString();
+
+private:
+ const unsigned int m_idtoSet;
+ const bool m_visibility;
+
+ // for unit testing
+ //template <typename id_type, typename otype_type, typename visibility_type> friend class SetVisibilityCommandEqMatcherP3;
+};
+
+
+#endif /* _SURFACEGROUPSETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/src/CreateCommand.cpp b/LayerManagerCommands/src/CreateCommand.cpp
deleted file mode 100644
index c436947..0000000
--- a/LayerManagerCommands/src/CreateCommand.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "CreateCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-CreateCommand::CreateCommand(unsigned int handle, ObjectType createType, PixelFormat pixelformat, uint OriginalWidth, uint OriginalHeight, uint* idReturn)
-: m_createType(createType)
-, m_nativeHandle(handle)
-, m_pixelformat(pixelformat)
-, m_originalWidth(OriginalWidth)
-, m_originalHeight(OriginalHeight)
-, m_idReturn(idReturn)
-{
-}
-
-ExecutionResult CreateCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
- bool result = false;
-
- switch(m_createType)
- {
- case TypeSurface:
- result = createSurface(scene);
- break;
-
- case TypeLayer:
- result = createLayer(scene);
- break;
-
- case TypeSurfaceGroup:
- result = createSurfaceGroup(scene);
- break;
-
- case TypeLayerGroup:
- result = createLayerGroup(scene);
- break;
-
- default:
- LOG_ERROR("CreateCommand", "could not create unknown type.");
- break;
- }
- return result ? ExecutionSuccessRedraw : ExecutionFailed;
-}
-
-bool CreateCommand::createSurface(IScene& scene)
-{
- Surface *surface = scene.createSurface(*m_idReturn);
- if (!surface)
- {
- return false;
- }
-
- *m_idReturn = surface->getID();
-
- surface->nativeHandle = m_nativeHandle;
- surface->setPixelFormat(m_pixelformat);
- surface->OriginalSourceWidth = m_originalWidth;
- surface->OriginalSourceHeight = m_originalHeight;
- surface->setDestinationRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
- surface->setSourceRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
-
- LOG_DEBUG("CreateCommand", "Created surface with new id: " << surface->getID() << " handle " << m_nativeHandle << " pixelformat:" << m_pixelformat << " originalwidth:" << m_originalWidth<< " originalheighth:" << m_originalHeight);
-
- return true;
-}
-
-bool CreateCommand::createLayer(IScene& scene)
-{
- Layer *l = scene.createLayer(*m_idReturn);
- if ( l == NULL )
- {
- return false;
- }
-
- *m_idReturn = l->getID();
-
- l->setDestinationRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
- l->setSourceRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
- l->OriginalSourceWidth = m_originalWidth;
- l->OriginalSourceHeight = m_originalHeight;
-
- LOG_DEBUG("CreateCommand", "created layer with id: " << l->getID() << "width: " << m_originalWidth << " height: " << m_originalHeight);
- return true;
-}
-
-bool CreateCommand::createSurfaceGroup(IScene& scene)
-{
- SurfaceGroup *sg = scene.createSurfaceGroup(*m_idReturn);
-
- if ( sg == NULL )
- {
- return false;
- }
-
- *m_idReturn = sg->getID();
-
- LOG_DEBUG("CreateCommand", "created surfacegroup with id:" << sg->getID());
- return true;
-}
-
-bool CreateCommand::createLayerGroup(IScene& scene)
-{
- LayerGroup *lg = scene.createLayerGroup(*m_idReturn);
-
- if ( lg == NULL )
- {
- return false;
- }
-
- *m_idReturn = lg->getID();
-
- LOG_DEBUG("CreateCommand", "created layergroup with id: " << lg->getID());
- return true;
-}
-
-const std::string CreateCommand::getString()
-{
- std::stringstream description;
- description << "CreateCommand("
- << "createType=" << m_createType
- << ", nativeHandle=" << m_nativeHandle
- << ", pixelformat=" << m_pixelformat
- << ", OriginalWidth=" << m_originalWidth
- << ", OriginalHeight=" << m_originalHeight
- << ", idReturn=" << m_idReturn << "=" << *m_idReturn
- << ")";
- return description.str();
-}
diff --git a/LayerManagerCommands/src/LayerCreateCommand.cpp b/LayerManagerCommands/src/LayerCreateCommand.cpp
new file mode 100644
index 0000000..bec4c78
--- /dev/null
+++ b/LayerManagerCommands/src/LayerCreateCommand.cpp
@@ -0,0 +1,61 @@
+/***************************************************************************
+*
+* 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 "LayerCreateCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+LayerCreateCommand::LayerCreateCommand(uint OriginalWidth, uint OriginalHeight, uint* idReturn)
+: m_originalWidth(OriginalWidth)
+, m_originalHeight(OriginalHeight)
+, m_idReturn(idReturn)
+{
+}
+
+ExecutionResult LayerCreateCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+ ExecutionResult result = ExecutionFailed;
+
+ Layer *layer = scene.createLayer(*m_idReturn);
+ if (layer)
+ {
+ *m_idReturn = layer->getID();
+
+ layer->setDestinationRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
+ layer->setSourceRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
+ layer->OriginalSourceWidth = m_originalWidth;
+ layer->OriginalSourceHeight = m_originalHeight;
+
+ LOG_DEBUG("LayerCreateCommand", "created layer with id: " << layer->getID() << "width: " << m_originalWidth << " height: " << m_originalHeight);
+ result = ExecutionSuccess;
+ }
+ return result;
+}
+
+const std::string LayerCreateCommand::getString()
+{
+ std::stringstream description;
+ description << "LayerCreateCommand("
+ << "OriginalWidth=" << m_originalWidth
+ << ", OriginalHeight=" << m_originalHeight
+ << ", idReturn=" << m_idReturn << "=" << *m_idReturn
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/LayerDumpCommand.cpp b/LayerManagerCommands/src/LayerDumpCommand.cpp
new file mode 100644
index 0000000..0f7d855
--- /dev/null
+++ b/LayerManagerCommands/src/LayerDumpCommand.cpp
@@ -0,0 +1,79 @@
+/***************************************************************************
+ *
+ * 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 "LayerDumpCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+LayerDumpCommand::LayerDumpCommand(char* givenfilename, unsigned int id)
+: m_filename(givenfilename)
+, m_id(id)
+{
+}
+
+ExecutionResult LayerDumpCommand::execute(ICommandExecutor* executor)
+{
+ ExecutionResult result = ExecutionFailed;
+ Scene& scene = *(executor->getScene());
+ RendererList& m_rendererList = *(executor->getRendererList());
+
+ bool status = false;
+ unsigned int layer_id = 0;
+
+ LOG_INFO("LayerDumpCommand","making screenshot, output file: " << m_filename);
+
+ if (scene.getLayer(m_id))
+ {
+ status = scene.isLayerInCurrentRenderOrder(m_id);
+ if (!status)
+ {
+ LOG_WARNING("LayerDumpCommand","Requested layer: " << m_id << " does not belong to the current render order");
+ }
+ }
+
+ if (status)
+ {
+ // call screen shot on all renderers for now TODO
+ RendererListConstIterator iter = m_rendererList.begin();
+ RendererListConstIterator iterEnd = m_rendererList.end();
+
+ for (; iter != iterEnd; ++iter)
+ {
+ IRenderer* renderer = *iter;
+
+ if (renderer)
+ {
+ renderer->doScreenShotOfLayer(m_filename, m_id);
+ }
+ }
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string LayerDumpCommand::getString()
+{
+ std::stringstream description;
+ description << "LayerDumpCommand("
+ << "filename=" << m_filename
+ << ", id=" << m_id
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/GetDimensionCommand.cpp b/LayerManagerCommands/src/LayerGetDimensionCommand.cpp
index 35c54a2..39dbdec 100644
--- a/LayerManagerCommands/src/GetDimensionCommand.cpp
+++ b/LayerManagerCommands/src/LayerGetDimensionCommand.cpp
@@ -16,46 +16,30 @@
* limitations under the License.
*
****************************************************************************/
-#include "GetDimensionCommand.h"
+
+#include "LayerGetDimensionCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-GetDimensionCommand::GetDimensionCommand(int id, ObjectType type, uint* widthRet, uint* heightRet)
+LayerGetDimensionCommand::LayerGetDimensionCommand(int id, uint* widthRet, uint* heightRet)
: m_id(id)
-, m_type(type)
, m_pWidth(widthRet)
, m_pHeight(heightRet)
{
}
-ExecutionResult GetDimensionCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerGetDimensionCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* graphicalObject = NULL;
+ Layer* layer = scene.getLayer(m_id);
- switch (m_type)
+ if (layer)
{
- case TypeSurface:
- graphicalObject = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- graphicalObject = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
-
- if (graphicalObject)
- {
- Vector2 dim = graphicalObject->getDimension();
+ Vector2 dim = layer->getDimension();
*m_pWidth = dim.val1;
*m_pHeight = dim.val2;
result = ExecutionSuccess;
@@ -69,14 +53,14 @@ ExecutionResult GetDimensionCommand::execute(ICommandExecutor* executor)
return result;
}
-const std::string GetDimensionCommand::getString()
+const std::string LayerGetDimensionCommand::getString()
{
std::stringstream description;
- description << "GetDimensionCommand("
+ description << "LayerGetDimensionCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", pWidth=" << m_pWidth << "=" << *m_pWidth
<< ", m_pHeight=" << m_pHeight << "=" << *m_pHeight
<< ")";
return description.str();
}
+
diff --git a/LayerManagerCommands/src/GetOpacityCommand.cpp b/LayerManagerCommands/src/LayerGetOpacityCommand.cpp
index 1c35ed5..2eca97e 100644
--- a/LayerManagerCommands/src/GetOpacityCommand.cpp
+++ b/LayerManagerCommands/src/LayerGetOpacityCommand.cpp
@@ -16,63 +16,39 @@
* limitations under the License.
*
****************************************************************************/
-#include "GetOpacityCommand.h"
+#include "LayerGetOpacityCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-GetOpacityCommand::GetOpacityCommand(int id, ObjectType type, double* returnOpacity)
+LayerGetOpacityCommand::LayerGetOpacityCommand(int id, double* returnOpacity)
: m_id(id)
-, m_type(type)
, m_pReturnOpacity(returnOpacity)
{
}
-ExecutionResult GetOpacityCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerGetOpacityCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalObject* go = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_type)
+ if (layer)
{
- case TypeSurface:
- go = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- go = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- go = scene.getSurfaceGroup(m_id);
- break;
-
- case TypeLayerGroup:
- go = scene.getLayerGroup(m_id);
- break;
-
- default:
- break;
- }
-
- if (go)
- {
- *m_pReturnOpacity = go->getOpacity();
+ *m_pReturnOpacity = layer->getOpacity();
result = ExecutionSuccess;
}
return result;
}
-const std::string GetOpacityCommand::getString()
+const std::string LayerGetOpacityCommand::getString()
{
std::stringstream description;
- description << "GetOpacityCommand("
+ description << "LayerGetOpacityCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", pReturnOpacity=" << m_pReturnOpacity << "=" << *m_pReturnOpacity
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/GetOrientationCommand.cpp b/LayerManagerCommands/src/LayerGetOrientationCommand.cpp
index ebcf8aa..bb05b13 100644
--- a/LayerManagerCommands/src/GetOrientationCommand.cpp
+++ b/LayerManagerCommands/src/LayerGetOrientationCommand.cpp
@@ -16,62 +16,39 @@
* limitations under the License.
*
****************************************************************************/
-#include "GetOrientationCommand.h"
+#include "LayerGetOrientationCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include <sstream>
-GetOrientationCommand::GetOrientationCommand(int id, ObjectType type, OrientationType* orientation)
+LayerGetOrientationCommand::LayerGetOrientationCommand(int id, OrientationType* orientation)
: m_id(id)
-, m_type(type)
, m_pReturnOrientation(orientation)
{
}
-ExecutionResult GetOrientationCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerGetOrientationCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- switch (m_type)
- {
- case TypeSurface:
- {
- Surface* surface = scene.getSurface(m_id);
- if (surface)
- {
- *m_pReturnOrientation = surface->getOrientation();
- result = ExecutionSuccess;
- }
- break;
- }
-
- case TypeLayer:
- {
- Layer* layer = scene.getLayer(m_id);
- if (layer)
- {
- *m_pReturnOrientation = layer->getOrientation();
- result = ExecutionSuccess;
- }
- break;
- }
+ Layer* layer = scene.getLayer(m_id);
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
+ if (layer)
+ {
+ *m_pReturnOrientation = layer->getOrientation();
+ result = ExecutionSuccess;
}
+
return result;
}
-const std::string GetOrientationCommand::getString()
+const std::string LayerGetOrientationCommand::getString()
{
std::stringstream description;
- description << "GetOrientationCommand("
+ description << "LayerGetOrientationCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", pReturnOrientation=" << m_pReturnOrientation << "=" << *m_pReturnOrientation
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/GetPositionCommand.cpp b/LayerManagerCommands/src/LayerGetPositionCommand.cpp
index 072cf1f..5aecf9f 100644
--- a/LayerManagerCommands/src/GetPositionCommand.cpp
+++ b/LayerManagerCommands/src/LayerGetPositionCommand.cpp
@@ -16,46 +16,29 @@
* limitations under the License.
*
****************************************************************************/
-#include "GetPositionCommand.h"
+#include "LayerGetPositionCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-GetPositionCommand::GetPositionCommand(int id, ObjectType type, unsigned int* xRet, unsigned int* yRet)
+LayerGetPositionCommand::LayerGetPositionCommand(int id, unsigned int* xRet, unsigned int* yRet)
: m_id(id)
-, m_type(type)
, m_pX(xRet)
, m_pY(yRet)
{
}
-ExecutionResult GetPositionCommand::execute(ICommandExecutor* execute)
+ExecutionResult LayerGetPositionCommand::execute(ICommandExecutor* execute)
{
Scene& scene = *(execute->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* go = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_type)
+ if (layer)
{
- case TypeSurface:
- go = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- go = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
-
- if (go)
- {
- Vector2 dim = go->getPosition();
+ Vector2 dim = layer->getPosition();
*m_pX = dim.val1;
*m_pY = dim.val2;
result = ExecutionSuccess;
@@ -69,12 +52,11 @@ ExecutionResult GetPositionCommand::execute(ICommandExecutor* execute)
return result;
}
-const std::string GetPositionCommand::getString()
+const std::string LayerGetPositionCommand::getString()
{
std::stringstream description;
- description << "GetPositionCommand("
+ description << "LayerGetPositionCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", pX=" << m_pX << "=" << *m_pX
<< ", pY=" << m_pY << "=" << *m_pY
<< ")";
diff --git a/LayerManagerCommands/src/GetVisibilityCommand.cpp b/LayerManagerCommands/src/LayerGetVisibilityCommand.cpp
index 005414a..4a3813e 100644
--- a/LayerManagerCommands/src/GetVisibilityCommand.cpp
+++ b/LayerManagerCommands/src/LayerGetVisibilityCommand.cpp
@@ -16,65 +16,41 @@
* limitations under the License.
*
****************************************************************************/
-#include "GetVisibilityCommand.h"
+#include "LayerGetVisibilityCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-GetVisibilityCommand::GetVisibilityCommand(int id, ObjectType type, bool* visibility)
+LayerGetVisibilityCommand::LayerGetVisibilityCommand(int id, bool* visibility)
: m_id(id)
-, m_type(type)
, m_pVisibility(visibility)
{
}
-ExecutionResult GetVisibilityCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerGetVisibilityCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
- LOG_DEBUG("GetVisibilityCommand", "start of");
+ LOG_DEBUG("LayerGetVisibilityCommand", "start of");
ExecutionResult result = ExecutionFailed;
- GraphicalObject* go = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_type)
+ if (layer)
{
- case TypeSurface:
- go = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- go = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- go = scene.getSurfaceGroup(m_id);
- break;
-
- case TypeLayerGroup:
- go = scene.getLayerGroup(m_id);
- break;
-
- default:
- break;
- }
-
- if (go)
- {
- *m_pVisibility = go->getVisibility();
- LOG_DEBUG("GetVisibilityCommand", "returned:" << *m_pVisibility);
+ *m_pVisibility = layer->getVisibility();
+ LOG_DEBUG("LayerGetVisibilityCommand", "returned:" << *m_pVisibility);
result = ExecutionSuccess;
}
return result;
}
-const std::string GetVisibilityCommand::getString()
+const std::string LayerGetVisibilityCommand::getString()
{
std::stringstream description;
- description << "GetVisibilityCommand("
+ description << "LayerGetVisibilityCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", pVisibility=" << m_pVisibility << "=" << *m_pVisibility
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/LayerRemoveCommand.cpp b/LayerManagerCommands/src/LayerRemoveCommand.cpp
new file mode 100644
index 0000000..e9092ba
--- /dev/null
+++ b/LayerManagerCommands/src/LayerRemoveCommand.cpp
@@ -0,0 +1,53 @@
+/***************************************************************************
+*
+* 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 "LayerRemoveCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+#include <sstream>
+
+LayerRemoveCommand::LayerRemoveCommand(unsigned int objectID)
+: m_idToRemove(objectID)
+{
+}
+
+ExecutionResult LayerRemoveCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Layer* layer = scene.getLayer(m_idToRemove);
+ if (layer)
+ {
+ scene.removeLayer(layer);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string LayerRemoveCommand::getString()
+{
+ std::stringstream description;
+ description << "LayerRemoveCommand("
+ << "idToRemove=" << m_idToRemove
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SetDestinationRectangleCommand.cpp b/LayerManagerCommands/src/LayerSetDestinationRectangleCommand.cpp
index cf06611..5cff050 100644
--- a/LayerManagerCommands/src/SetDestinationRectangleCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetDestinationRectangleCommand.cpp
@@ -16,15 +16,14 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetDestinationRectangleCommand.h"
+#include "LayerSetDestinationRectangleCommand.h"
#include "ICommandExecutor.h"
#include "GraphicalSurface.h"
#include "Scene.h"
#include <sstream>
-SetDestinationRectangleCommand::SetDestinationRectangleCommand(int id, ObjectType typeToSetOn, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
+LayerSetDestinationRectangleCommand::LayerSetDestinationRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
: m_id(id)
-, m_typeToSet(typeToSetOn)
, m_x(x)
, m_y(y)
, m_width(width)
@@ -32,46 +31,29 @@ SetDestinationRectangleCommand::SetDestinationRectangleCommand(int id, ObjectTyp
{
}
-ExecutionResult SetDestinationRectangleCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetDestinationRectangleCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* go = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_typeToSet)
- {
- case TypeSurface:
- go = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- go = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
-
- if (go)
+ if (layer)
{
const Rectangle rectangle(m_x, m_y, m_width, m_height);
- go->setDestinationRegion(rectangle);
+ layer->setDestinationRegion(rectangle);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetDestinationRectangleCommand::getString()
+const std::string LayerSetDestinationRectangleCommand::getString()
{
std::stringstream description;
- description << "SetDestinationRectangleCommand("
+ description << "LayerSetDestinationRectangleCommand("
<< "id=" << m_id
- << ", typeToSet=" << m_typeToSet
<< ", x=" << m_x
<< ", y=" << m_y
<< ", width=" << m_width
diff --git a/LayerManagerCommands/src/SetDimensionCommand.cpp b/LayerManagerCommands/src/LayerSetDimensionCommand.cpp
index b46e6e7..183d25b 100644
--- a/LayerManagerCommands/src/SetDimensionCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetDimensionCommand.cpp
@@ -16,58 +16,40 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetDimensionCommand.h"
+#include "LayerSetDimensionCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetDimensionCommand::SetDimensionCommand(int id, ObjectType typeToSetOn, unsigned int width,unsigned int height)
+LayerSetDimensionCommand::LayerSetDimensionCommand(int id, unsigned int width,unsigned int height)
: m_id(id)
-, m_typeToSet(typeToSetOn)
, m_width(width)
, m_height(height)
{
}
-ExecutionResult SetDimensionCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetDimensionCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* go = NULL;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_typeToSet)
+ if (layer)
{
- case TypeSurface:
- go = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- go = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
-
- if (go)
- {
- go->setDimension(m_width, m_height);
+ layer->setDimension(m_width, m_height);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetDimensionCommand::getString()
+const std::string LayerSetDimensionCommand::getString()
{
std::stringstream description;
- description << "SetDimensionCommand("
+ description << "LayerSetDimensionCommand("
<< "id=" << m_id
- << ", typeToSet=" << m_typeToSet
<< ", width=" << m_width
<< ", height=" << m_height
<< ")";
diff --git a/LayerManagerCommands/src/SetOpacityCommand.cpp b/LayerManagerCommands/src/LayerSetOpacityCommand.cpp
index fe661a4..9655fad 100644
--- a/LayerManagerCommands/src/SetOpacityCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetOpacityCommand.cpp
@@ -16,64 +16,40 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetOpacityCommand.h"
+#include "LayerSetOpacityCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetOpacityCommand::SetOpacityCommand(unsigned int id, ObjectType type, double Opacity)
+LayerSetOpacityCommand::LayerSetOpacityCommand(unsigned int id, double Opacity)
: m_id(id)
-, m_type(type)
, m_opacity(Opacity)
{
}
-ExecutionResult SetOpacityCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetOpacityCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalObject* gs = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_type)
+ if (layer)
{
- case TypeSurface:
- gs = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- gs = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- gs = scene.getSurfaceGroup(m_id);
- break;
-
- case TypeLayerGroup:
- gs = scene.getLayerGroup(m_id);
- break;
-
- default:
- break;
- }
-
- if (gs)
- {
- LOG_DEBUG("SetOpacityCommand","new opacity " << m_opacity << " for id: " << m_id);
- gs->setOpacity(m_opacity);
+ LOG_DEBUG("LayerSetOpacityCommand","new opacity " << m_opacity << " for id: " << m_id);
+ layer->setOpacity(m_opacity);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetOpacityCommand::getString()
+const std::string LayerSetOpacityCommand::getString()
{
std::stringstream description;
- description << "SetOpacityCommand("
+ description << "LayerSetOpacityCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", opacity=" << m_opacity
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/SetOrientationCommand.cpp b/LayerManagerCommands/src/LayerSetOrientationCommand.cpp
index 0ef3af9..7a31be8 100644
--- a/LayerManagerCommands/src/SetOrientationCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetOrientationCommand.cpp
@@ -16,56 +16,39 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetOrientationCommand.h"
+#include "LayerSetOrientationCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetOrientationCommand::SetOrientationCommand(unsigned int id, ObjectType type, OrientationType Orientation)
+LayerSetOrientationCommand::LayerSetOrientationCommand(unsigned int id, OrientationType Orientation)
: m_id(id)
-, m_type(type)
, m_orientation(Orientation)
{
}
-ExecutionResult SetOrientationCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetOrientationCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* graphicalSurface = NULL;
- switch(m_type)
- {
- case TypeSurface:
- graphicalSurface = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- graphicalSurface = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
+ Layer* layer = scene.getLayer(m_id);
- if (graphicalSurface)
+ if (layer)
{
- graphicalSurface->setOrientation(m_orientation);
+ layer->setOrientation(m_orientation);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetOrientationCommand::getString()
+const std::string LayerSetOrientationCommand::getString()
{
std::stringstream description;
- description << "SetOrientationCommand("
+ description << "LayerSetOrientationCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", orientation=" << m_orientation
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/SetPositionCommand.cpp b/LayerManagerCommands/src/LayerSetPositionCommand.cpp
index 3318e7e..6e21a47 100644
--- a/LayerManagerCommands/src/SetPositionCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetPositionCommand.cpp
@@ -16,57 +16,39 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetPositionCommand.h"
+#include "LayerSetPositionCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetPositionCommand::SetPositionCommand(unsigned int id, ObjectType typeToSetOn, unsigned int x, unsigned int y )
+LayerSetPositionCommand::LayerSetPositionCommand(unsigned int id, unsigned int x, unsigned int y )
: m_id(id)
-, m_typeToSet(typeToSetOn)
, m_x(x)
, m_y(y)
{
}
-ExecutionResult SetPositionCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetPositionCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* graphicalSurface = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_typeToSet)
+ if (layer)
{
- case TypeSurface:
- graphicalSurface = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- graphicalSurface = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
-
- if (graphicalSurface)
- {
- graphicalSurface->setPosition(m_x, m_y);
+ layer->setPosition(m_x, m_y);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetPositionCommand::getString()
+const std::string LayerSetPositionCommand::getString()
{
std::stringstream description;
- description << "SetPositionCommand("
+ description << "LayerSetPositionCommand("
<< "id=" << m_id
- << ", typeToSet=" << m_typeToSet
<< ", m_x=" << m_x
<< ", m_y=" << m_y
<< ")";
diff --git a/LayerManagerCommands/src/SetOrderWithinLayerCommand.cpp b/LayerManagerCommands/src/LayerSetRenderOrderCommand.cpp
index 3646cec..f97c66e 100644
--- a/LayerManagerCommands/src/SetOrderWithinLayerCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetRenderOrderCommand.cpp
@@ -16,19 +16,19 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetOrderWithinLayerCommand.h"
+#include "LayerSetRenderOrderCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetOrderWithinLayerCommand::SetOrderWithinLayerCommand(unsigned int layerid,unsigned int* array,unsigned int length)
+LayerSetRenderOrderCommand::LayerSetRenderOrderCommand(unsigned int layerid,unsigned int* array,unsigned int length)
: m_layerid(layerid)
, m_array(array)
, m_length(length)
{
}
-ExecutionResult SetOrderWithinLayerCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetRenderOrderCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
@@ -50,11 +50,11 @@ ExecutionResult SetOrderWithinLayerCommand::execute(ICommandExecutor* executor)
unsigned int layer_id = surface->getContainingLayerId();
if (layer_id != GraphicalObject::INVALID_ID)
{
- LOG_WARNING("SetOrderWithinLayerCommand","surface : id [ " << m_array[surfaceIndex] << " ] already belongs to layer : id [ " << layer_id << " ]");
+ LOG_WARNING("LayerSetRenderOrderCommand","surface : id [ " << m_array[surfaceIndex] << " ] already belongs to layer : id [ " << layer_id << " ]");
}
else
{
- LOG_DEBUG("SetOrderWithinLayerCommand","add surface " << surface->getID() << " to renderorder of layer " << m_layerid);
+ LOG_DEBUG("LayerSetRenderOrderCommand","add surface " << surface->getID() << " to renderorder of layer " << m_layerid);
layer->addSurface(surface);
result = ExecutionSuccessRedraw;
}
@@ -66,10 +66,10 @@ ExecutionResult SetOrderWithinLayerCommand::execute(ICommandExecutor* executor)
return result;
}
-const std::string SetOrderWithinLayerCommand::getString()
+const std::string LayerSetRenderOrderCommand::getString()
{
std::stringstream description;
- description << "SetOrderWithinLayerCommand("
+ description << "LayerSetRenderOrderCommand("
<< "layerid=" << m_layerid
<< ", m_array=[";
diff --git a/LayerManagerCommands/src/SetSourceRectangleCommand.cpp b/LayerManagerCommands/src/LayerSetSourceRectangleCommand.cpp
index de9b4b7..0a3fe4e 100644
--- a/LayerManagerCommands/src/SetSourceRectangleCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetSourceRectangleCommand.cpp
@@ -16,14 +16,13 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetSourceRectangleCommand.h"
+#include "LayerSetSourceRectangleCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetSourceRectangleCommand::SetSourceRectangleCommand(int id, ObjectType type, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
+LayerSetSourceRectangleCommand::LayerSetSourceRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
: m_id(id)
-, m_typeToSet(type)
, m_x(x)
, m_y(y)
, m_width(width)
@@ -31,46 +30,29 @@ SetSourceRectangleCommand::SetSourceRectangleCommand(int id, ObjectType type, un
{
}
-ExecutionResult SetSourceRectangleCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetSourceRectangleCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalSurface* graphicalSurface = 0;
+ Layer* layer = scene.getLayer(m_id);
- switch(m_typeToSet)
- {
- case TypeSurface:
- graphicalSurface = scene.getSurface(m_id);
- break;
-
- case TypeLayer:
- graphicalSurface = scene.getLayer(m_id);
- break;
-
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
-
- if (graphicalSurface )
+ if (layer)
{
const Rectangle rectangle(m_x, m_y, m_width, m_height);
- graphicalSurface->setSourceRegion(rectangle);
+ layer->setSourceRegion(rectangle);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetSourceRectangleCommand::getString()
+const std::string LayerSetSourceRectangleCommand::getString()
{
std::stringstream description;
- description << "SetSourceRectangleCommand("
+ description << "LayerSetSourceRectangleCommand("
<< "id=" << m_id
- << ", typeToSet=" << m_typeToSet
<< ", x=" << m_x
<< ", y=" << m_y
<< ", width=" << m_width
diff --git a/LayerManagerCommands/src/SetLayerTypeCommand.cpp b/LayerManagerCommands/src/LayerSetTypeCommand.cpp
index d56f8b1..fd30471 100644
--- a/LayerManagerCommands/src/SetLayerTypeCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetTypeCommand.cpp
@@ -16,18 +16,18 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetLayerTypeCommand.h"
+#include "LayerSetTypeCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetLayerTypeCommand::SetLayerTypeCommand(const uint givenid, LayerType layerType)
+LayerSetTypeCommand::LayerSetTypeCommand(const uint givenid, LayerType layerType)
: m_idtoSet(givenid)
, m_layerType(layerType)
{
}
-ExecutionResult SetLayerTypeCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetTypeCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
@@ -39,7 +39,7 @@ ExecutionResult SetLayerTypeCommand::execute(ICommandExecutor* executor)
if (layer)
{
- LOG_DEBUG("SetLayerTypeCommand", "setting type: " << m_layerType << " of id " << m_idtoSet);
+ LOG_DEBUG("LayerSetTypeCommand", "setting type: " << m_layerType << " of layer id " << m_idtoSet);
layer->setLayerType(m_layerType);
result = ExecutionSuccessRedraw;
}
@@ -47,10 +47,10 @@ ExecutionResult SetLayerTypeCommand::execute(ICommandExecutor* executor)
return result;
}
-const std::string SetLayerTypeCommand::getString()
+const std::string LayerSetTypeCommand::getString()
{
std::stringstream description;
- description << "SetLayerTypeCommand("
+ description << "LayerSetTypeCommand("
<< "idtoSet=" << m_idtoSet
<< ", layertype=" << m_layerType
<< ")";
diff --git a/LayerManagerCommands/src/SetVisibilityCommand.cpp b/LayerManagerCommands/src/LayerSetVisibilityCommand.cpp
index 0fed7fd..0a82749 100644
--- a/LayerManagerCommands/src/SetVisibilityCommand.cpp
+++ b/LayerManagerCommands/src/LayerSetVisibilityCommand.cpp
@@ -16,64 +16,40 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetVisibilityCommand.h"
+#include "LayerSetVisibilityCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetVisibilityCommand::SetVisibilityCommand(const uint givenid, ObjectType Objecttype, bool newvisibility)
+LayerSetVisibilityCommand::LayerSetVisibilityCommand(const uint givenid, bool newvisibility)
: m_idtoSet(givenid)
-, m_otype(Objecttype)
, m_visibility(newvisibility)
{
}
-ExecutionResult SetVisibilityCommand::execute(ICommandExecutor* executor)
+ExecutionResult LayerSetVisibilityCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- GraphicalObject* go = NULL;
+ Layer* layer = scene.getLayer(m_idtoSet);
- switch(m_otype)
+ if (layer)
{
- case TypeSurface:
- go = scene.getSurface(m_idtoSet);
- break;
-
- case TypeLayer:
- go = scene.getLayer(m_idtoSet);
- break;
-
- case TypeSurfaceGroup:
- go = scene.getSurfaceGroup(m_idtoSet);
- break;
-
- case TypeLayerGroup:
- go = scene.getLayerGroup(m_idtoSet);
- break;
-
- default:
- break;
- }
-
- if (go)
- {
- LOG_DEBUG("SetVisibilityCommand", "setting visibility: " << m_visibility << " of id " << m_idtoSet);
- go->setVisibility(m_visibility);
+ LOG_DEBUG("LayerSetVisibilityCommand", "setting visibility: " << m_visibility << " of id " << m_idtoSet);
+ layer->setVisibility(m_visibility);
result = ExecutionSuccessRedraw;
}
return result;
}
-const std::string SetVisibilityCommand::getString()
+const std::string LayerSetVisibilityCommand::getString()
{
std::stringstream description;
- description << "SetVisibilityCommand("
+ description << "LayerSetVisibilityCommand("
<< "idtoSet=" << m_idtoSet
- << ", otype=" << m_otype
<< ", visibility=" << m_visibility
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/LayergroupCreateCommand.cpp b/LayerManagerCommands/src/LayergroupCreateCommand.cpp
new file mode 100644
index 0000000..bc321f1
--- /dev/null
+++ b/LayerManagerCommands/src/LayergroupCreateCommand.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+*
+* 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"
+
+LayergroupCreateCommand::LayergroupCreateCommand(uint* idReturn)
+: m_idReturn(idReturn)
+{
+}
+
+ExecutionResult LayergroupCreateCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+ ExecutionResult result = ExecutionFailed;
+
+ LayerGroup *layergroup = scene.createLayerGroup(*m_idReturn);
+
+ 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();
+}
diff --git a/LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp b/LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp
new file mode 100644
index 0000000..199302f
--- /dev/null
+++ b/LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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 "LayergroupGetOpacityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+LayergroupGetOpacityCommand::LayergroupGetOpacityCommand(int id, double* returnOpacity)
+: m_id(id)
+, m_pReturnOpacity(returnOpacity)
+{
+}
+
+ExecutionResult LayergroupGetOpacityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ LayerGroup* layergroup = scene.getLayerGroup(m_id);
+
+ if (layergroup)
+ {
+ *m_pReturnOpacity = layergroup->getOpacity();
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string LayergroupGetOpacityCommand::getString()
+{
+ std::stringstream description;
+ description << "LayergroupGetOpacityCommand("
+ << "id=" << m_id
+ << ", pReturnOpacity=" << m_pReturnOpacity << "=" << *m_pReturnOpacity
+ << ")";
+ return description.str();
+}
+
diff --git a/LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp b/LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp
new file mode 100644
index 0000000..bf6c750
--- /dev/null
+++ b/LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp
@@ -0,0 +1,57 @@
+/***************************************************************************
+*
+* 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 "LayergroupGetVisibilityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+LayergroupGetVisibilityCommand::LayergroupGetVisibilityCommand(int id, bool* visibility)
+: m_id(id)
+, m_pVisibility(visibility)
+{
+}
+
+ExecutionResult LayergroupGetVisibilityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ LOG_DEBUG("LayergroupGetVisibilityCommand", "start of");
+
+ ExecutionResult result = ExecutionFailed;
+
+ LayerGroup* layergroup = scene.getLayerGroup(m_id);
+
+ if (layergroup)
+ {
+ *m_pVisibility = layergroup->getVisibility();
+ LOG_DEBUG("LayergroupGetVisibilityCommand", "returned:" << *m_pVisibility);
+ result = ExecutionSuccess;
+ }
+ return result;
+}
+
+const std::string LayergroupGetVisibilityCommand::getString()
+{
+ std::stringstream description;
+ description << "LayergroupGetVisibilityCommand("
+ << "id=" << m_id
+ << ", pVisibility=" << m_pVisibility << "=" << *m_pVisibility
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/LayergroupRemoveCommand.cpp b/LayerManagerCommands/src/LayergroupRemoveCommand.cpp
new file mode 100644
index 0000000..12f20bb
--- /dev/null
+++ b/LayerManagerCommands/src/LayergroupRemoveCommand.cpp
@@ -0,0 +1,53 @@
+/***************************************************************************
+*
+* 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>
+
+LayergroupRemoveCommand::LayergroupRemoveCommand(unsigned int objectID)
+: m_idToRemove(objectID)
+{
+}
+
+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();
+}
diff --git a/LayerManagerCommands/src/LayergroupSetOpacityCommand.cpp b/LayerManagerCommands/src/LayergroupSetOpacityCommand.cpp
new file mode 100644
index 0000000..26e955c
--- /dev/null
+++ b/LayerManagerCommands/src/LayergroupSetOpacityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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"
+
+LayergroupSetOpacityCommand::LayergroupSetOpacityCommand(unsigned int id, double Opacity)
+: m_id(id)
+, m_opacity(Opacity)
+{
+}
+
+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);
+ layergroup->setOpacity(m_opacity);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string LayergroupSetOpacityCommand::getString()
+{
+ std::stringstream description;
+ description << "LayergroupSetOpacityCommand("
+ << "id=" << m_id
+ << ", opacity=" << m_opacity
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/LayergroupSetVisibilityCommand.cpp b/LayerManagerCommands/src/LayergroupSetVisibilityCommand.cpp
new file mode 100644
index 0000000..bc60ef6
--- /dev/null
+++ b/LayerManagerCommands/src/LayergroupSetVisibilityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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"
+
+LayergroupSetVisibilityCommand::LayergroupSetVisibilityCommand(const uint givenid, bool newvisibility)
+: m_idtoSet(givenid)
+, m_visibility(newvisibility)
+{
+}
+
+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);
+ layergroup->setVisibility(m_visibility);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string LayergroupSetVisibilityCommand::getString()
+{
+ std::stringstream description;
+ description << "LayergroupSetVisibilityCommand("
+ << "idtoSet=" << m_idtoSet
+ << ", visibility=" << m_visibility
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/RemoveCommand.cpp b/LayerManagerCommands/src/RemoveCommand.cpp
deleted file mode 100644
index d7ec90a..0000000
--- a/LayerManagerCommands/src/RemoveCommand.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "RemoveCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-#include <sstream>
-
-RemoveCommand::RemoveCommand(unsigned int objectID, ObjectType typeToRemove)
-: m_idToRemove(objectID)
-, m_typeToRemove(typeToRemove)
-{
-}
-
-ExecutionResult RemoveCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
-
- ExecutionResult result = ExecutionFailed;
-
- switch(m_typeToRemove)
- {
- case TypeSurface:
- {
- Surface* surface = scene.getSurface(m_idToRemove);
- if (surface)
- {
- scene.removeSurface(surface);
- result = ExecutionSuccessRedraw;
- }
- break;
- }
-
- case TypeLayer:
- {
- Layer* layer = scene.getLayer(m_idToRemove);
- if (layer)
- {
- scene.removeLayer(layer);
- result = ExecutionSuccessRedraw;
- }
- break;
- }
-
- case TypeSurfaceGroup:
- {
- SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_idToRemove);
- if (surfacegroup)
- {
- scene.removeSurfaceGroup(surfacegroup);
- result = ExecutionSuccessRedraw;
- }
- break;
- }
-
- case TypeLayerGroup:
- {
- LayerGroup* layergroup = scene.getLayerGroup(m_idToRemove);
- if (layergroup)
- {
- scene.removeLayerGroup(layergroup);
- result = ExecutionSuccessRedraw;
- }
- break;
- }
-
- default:
- LOG_ERROR("RemoveCommand", "could not destroy unknown type.");
- break;
- }
-
- return result;
-}
-
-const std::string RemoveCommand::getString()
-{
- std::stringstream description;
- description << "RemoveCommand("
- << "idToRemove=" << m_idToRemove
- << ", typeToRemove=" << m_typeToRemove
- << ")";
- return description.str();
-}
diff --git a/LayerManagerCommands/src/ScreenDumpCommand.cpp b/LayerManagerCommands/src/ScreenDumpCommand.cpp
new file mode 100644
index 0000000..0bb3096
--- /dev/null
+++ b/LayerManagerCommands/src/ScreenDumpCommand.cpp
@@ -0,0 +1,72 @@
+/***************************************************************************
+ *
+ * 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 "ScreenDumpCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+ScreenDumpCommand::ScreenDumpCommand(char* givenfilename, unsigned int id)
+: m_filename(givenfilename)
+, m_id(id)
+{
+}
+
+ExecutionResult ScreenDumpCommand::execute(ICommandExecutor* executor)
+{
+ ExecutionResult result = ExecutionFailed;
+ Scene& scene = *(executor->getScene());
+ RendererList& m_rendererList = *(executor->getRendererList());
+
+ bool status = false;
+ unsigned int layer_id = 0;
+
+ LOG_INFO("ScreenDumpCommand","making screenshot, output file: " << m_filename);
+
+ status = (m_id == 0);
+
+ if (status)
+ {
+ // call screen shot on all renderers for now TODO
+ RendererListConstIterator iter = m_rendererList.begin();
+ RendererListConstIterator iterEnd = m_rendererList.end();
+
+ for (; iter != iterEnd; ++iter)
+ {
+ IRenderer* renderer = *iter;
+
+ if (renderer)
+ {
+ renderer->doScreenShot(m_filename);
+ }
+ }
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string ScreenDumpCommand::getString()
+{
+ std::stringstream description;
+ description << "ScreenDumpCommand("
+ << "filename=" << m_filename
+ << ", id=" << m_id
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SetLayerOrderCommand.cpp b/LayerManagerCommands/src/ScreenSetRenderOrderCommand.cpp
index 665d4e5..162ada8 100644
--- a/LayerManagerCommands/src/SetLayerOrderCommand.cpp
+++ b/LayerManagerCommands/src/ScreenSetRenderOrderCommand.cpp
@@ -16,18 +16,18 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetLayerOrderCommand.h"
+#include "ScreenSetRenderOrderCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-SetLayerOrderCommand::SetLayerOrderCommand(unsigned int* array, unsigned int length)
+ScreenSetRenderOrderCommand::ScreenSetRenderOrderCommand(unsigned int* array, unsigned int length)
: m_array(array)
, m_length(length)
{
}
-ExecutionResult SetLayerOrderCommand::execute(ICommandExecutor* executor)
+ExecutionResult ScreenSetRenderOrderCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
@@ -56,17 +56,17 @@ ExecutionResult SetLayerOrderCommand::execute(ICommandExecutor* executor)
scene.getCurrentRenderOrder().clear();
- LOG_DEBUG("SetLayerOrderCommand", "Length to set: " << m_length);
+ LOG_DEBUG("ScreenSetRenderOrderCommand", "Length to set: " << m_length);
ExecutionResult result = ExecutionFailed;
for (unsigned int i = 0; i < m_length; i++)
{
- LOG_DEBUG("SetLayerOrderCommand", "Trying to add layer: " << m_array[i] << " to current render order");
+ LOG_DEBUG("ScreenSetRenderOrderCommand", "Trying to add layer: " << m_array[i] << " to current render order");
Layer* layer = scene.getLayer(m_array[i]);
if (layer)
{
- LOG_DEBUG("SetLayerOrderCommand", "Adding Layer: " << m_array[i] << " to current render order");
+ LOG_DEBUG("ScreenSetRenderOrderCommand", "Adding Layer: " << m_array[i] << " to current render order");
scene.getCurrentRenderOrder().push_back(layer);
result = ExecutionSuccessRedraw;
}
@@ -74,10 +74,10 @@ ExecutionResult SetLayerOrderCommand::execute(ICommandExecutor* executor)
return result;
}
-const std::string SetLayerOrderCommand::getString()
+const std::string ScreenSetRenderOrderCommand::getString()
{
std::stringstream description;
- description << "SetLayerOrderCommand("
+ description << "ScreenSetRenderOrderCommand("
<< "m_array=[";
for (unsigned int i = 0; i < m_length; ++i)
diff --git a/LayerManagerCommands/src/ScreenShotCommand.cpp b/LayerManagerCommands/src/ScreenShotCommand.cpp
deleted file mode 100644
index fd0b33a..0000000
--- a/LayerManagerCommands/src/ScreenShotCommand.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT GmbH
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ****************************************************************************/
-#include "ScreenShotCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-ScreenShotCommand::ScreenShotCommand(char* givenfilename, ScreenShotType type, unsigned int id)
-: m_filename(givenfilename)
-, m_id(id)
-, m_type(type)
-{
-}
-
-ExecutionResult ScreenShotCommand::execute(ICommandExecutor* executor)
-{
- Scene& scene = *(executor->getScene());
- RendererList& m_rendererList = *(executor->getRendererList());
-
- bool status = false;
- unsigned int layer_id = 0;
-
- LOG_INFO("ScreenShotCommand","making screenshot, output file: " << m_filename);
-
- // check for invalid screen, surface or layer ids
- switch (m_type)
- {
- case ScreenshotOfDisplay:
- status = (m_id == 0);
- break;
-
- case ScreenshotOfLayer:
- if (scene.getLayer(m_id))
- {
- status = scene.isLayerInCurrentRenderOrder(m_id);
- if (!status)
- {
- LOG_WARNING("ScreenShotCommand","Requested layer: " << m_id << " does not belong to the current render order");
- }
- }
- break;
-
- case ScreenshotOfSurface:
- if (scene.getSurface(m_id))
- {
- layer_id = scene.getSurface(m_id)->getContainingLayerId();
- status = scene.isLayerInCurrentRenderOrder(layer_id);
- if (!status)
- {
- LOG_WARNING("ScreenShotCommand","Requested surface: " << m_id << " does not belong to a layer which is part of the current render order");
- }
- }
- break;
-
- case ScreenShotNone:
- status = true;
- break;
- }
-
- if (!status)
- {
- return ExecutionFailed;
- }
-
- // call screen shot on all renderers for now TODO
- RendererListConstIterator iter = m_rendererList.begin();
- RendererListConstIterator iterEnd = m_rendererList.end();
-
- for (; iter != iterEnd; ++iter)
- {
- IRenderer* renderer = *iter;
-
- if (renderer)
- {
- switch (m_type)
- {
- case ScreenshotOfDisplay:
- {
- renderer->doScreenShot(m_filename);
- break;
- }
-
- case ScreenshotOfLayer:
- {
- renderer->doScreenShotOfLayer(m_filename, m_id);
- break;
- }
-
- case ScreenshotOfSurface:
- {
- renderer->doScreenShotOfSurface(m_filename, m_id, layer_id);
- break;
- }
-
- case ScreenShotNone:
- break;
-
- default:
- status = false;
- break;
- }
- }
- }
- return status ? ExecutionSuccessRedraw : ExecutionFailed;
-}
-
-const std::string ScreenShotCommand::getString()
-{
- std::stringstream description;
- description << "ScreenShotCommand("
- << "filename=" << m_filename
- << ", id=" << m_id
- << ", type=" << m_type
- << ")";
- return description.str();
-}
diff --git a/LayerManagerCommands/src/CreateShaderCommand.cpp b/LayerManagerCommands/src/ShaderCreateCommand.cpp
index 6166d97..8239f96 100644
--- a/LayerManagerCommands/src/CreateShaderCommand.cpp
+++ b/LayerManagerCommands/src/ShaderCreateCommand.cpp
@@ -16,19 +16,19 @@
* limitations under the License.
*
****************************************************************************/
-#include "CreateShaderCommand.h"
+#include "ShaderCreateCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-CreateShaderCommand::CreateShaderCommand(const std::string& vertName, const std::string& fragName, unsigned int* id)
+ShaderCreateCommand::ShaderCreateCommand(const std::string& vertName, const std::string& fragName, unsigned int* id)
: m_vertName(vertName)
, m_fragName(fragName)
, m_returnID(id)
{
}
-ExecutionResult CreateShaderCommand::execute(ICommandExecutor* executor)
+ExecutionResult ShaderCreateCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
@@ -52,20 +52,20 @@ ExecutionResult CreateShaderCommand::execute(ICommandExecutor* executor)
return result;
}
-const std::string CreateShaderCommand::getVertName() const
+const std::string ShaderCreateCommand::getVertName() const
{
return m_vertName;
}
-const std::string CreateShaderCommand::getFragName() const
+const std::string ShaderCreateCommand::getFragName() const
{
return m_fragName;
}
-const std::string CreateShaderCommand::getString()
+const std::string ShaderCreateCommand::getString()
{
std::stringstream description;
- description << "CreateShaderCommand("
+ description << "ShaderCreateCommand("
<< "vertName=" << m_vertName
<< ", fragName=" << m_fragName
<< ")";
diff --git a/LayerManagerCommands/src/DestroyShaderCommand.cpp b/LayerManagerCommands/src/ShaderDestroyCommand.cpp
index e769b86..f234fdf 100644
--- a/LayerManagerCommands/src/DestroyShaderCommand.cpp
+++ b/LayerManagerCommands/src/ShaderDestroyCommand.cpp
@@ -16,18 +16,18 @@
* limitations under the License.
*
****************************************************************************/
-#include "DestroyShaderCommand.h"
+#include "ShaderDestroyCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
#include "ShaderMap.h"
-DestroyShaderCommand::DestroyShaderCommand(unsigned int shaderid)
+ShaderDestroyCommand::ShaderDestroyCommand(unsigned int shaderid)
: m_id(shaderid)
{
}
-ExecutionResult DestroyShaderCommand::execute(ICommandExecutor* executor)
+ExecutionResult ShaderDestroyCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ShaderMap& shaderMap = scene.m_shaderMap;
@@ -64,7 +64,7 @@ ExecutionResult DestroyShaderCommand::execute(ICommandExecutor* executor)
}
/// detach shader from all surfaces, surface groups, etc... from surfaces
-void DestroyShaderCommand::removeShaderFromAllSurfaces(const SurfaceMap & surfaceMap, Shader* shader)
+void ShaderDestroyCommand::removeShaderFromAllSurfaces(const SurfaceMap & surfaceMap, Shader* shader)
{
SurfaceMapConstIterator iter = surfaceMap.begin();
SurfaceMapConstIterator iterEnd = surfaceMap.end();
@@ -79,7 +79,7 @@ void DestroyShaderCommand::removeShaderFromAllSurfaces(const SurfaceMap & surfac
}
}
-void DestroyShaderCommand::removeShaderFromAllLayers(const LayerMap & layerMap, Shader *& shader)
+void ShaderDestroyCommand::removeShaderFromAllLayers(const LayerMap & layerMap, Shader *& shader)
{
LayerMapConstIterator iter = layerMap.begin();
LayerMapConstIterator iterEnd = layerMap.end();
@@ -94,12 +94,12 @@ void DestroyShaderCommand::removeShaderFromAllLayers(const LayerMap & layerMap,
}
}
-unsigned int DestroyShaderCommand::getShaderID() const
+unsigned int ShaderDestroyCommand::getShaderID() const
{
return m_id;
}
-const std::string DestroyShaderCommand::getString()
+const std::string ShaderDestroyCommand::getString()
{
std::stringstream description;
description << "DestroyShaderCommand("
diff --git a/LayerManagerCommands/src/SetUniformsCommand.cpp b/LayerManagerCommands/src/ShaderSetUniformsCommand.cpp
index 73a6ee4..cf9c98f 100644
--- a/LayerManagerCommands/src/SetUniformsCommand.cpp
+++ b/LayerManagerCommands/src/ShaderSetUniformsCommand.cpp
@@ -16,19 +16,19 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetUniformsCommand.h"
+#include "ShaderSetUniformsCommand.h"
#include "ICommandExecutor.h"
#include "UniformMap.h"
#include "Scene.h"
#include "Log.h"
-SetUniformsCommand::SetUniformsCommand(unsigned int shaderid, const std::vector<std::string>& uniforms)
+ShaderSetUniformsCommand::ShaderSetUniformsCommand(unsigned int shaderid, const std::vector<std::string>& uniforms)
: m_shaderid(shaderid)
, m_uniforms(uniforms)
{
}
-ExecutionResult SetUniformsCommand::execute(ICommandExecutor* executor)
+ExecutionResult ShaderSetUniformsCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
@@ -60,7 +60,7 @@ ExecutionResult SetUniformsCommand::execute(ICommandExecutor* executor)
}
else
{
- LOG_ERROR("Layermanager", "Failed to parse uniform description");
+ LOG_ERROR("ShaderSetUniformsCommand", "Failed to parse uniform description");
result = ExecutionFailed;
}
}
@@ -68,33 +68,33 @@ ExecutionResult SetUniformsCommand::execute(ICommandExecutor* executor)
else
{
// shader not found
- LOG_ERROR("Layermanager", "shader ID " << m_shaderid << " found but object was null");
+ LOG_ERROR("ShaderSetUniformsCommand", "shader ID " << m_shaderid << " found but object was null");
result = ExecutionFailed;
}
}
else
{
// shader not found
- LOG_ERROR("Layermanager", "shader ID "<<m_shaderid<<" not found");
+ LOG_ERROR("ShaderSetUniformsCommand", "shader ID "<<m_shaderid<<" not found");
result = ExecutionFailed;
}
return result;
}
-const std::vector<std::string> SetUniformsCommand::getUniforms() const
+const std::vector<std::string> ShaderSetUniformsCommand::getUniforms() const
{
return m_uniforms;
}
-unsigned int SetUniformsCommand::getShaderId() const
+unsigned int ShaderSetUniformsCommand::getShaderId() const
{
return m_shaderid;
}
-const std::string SetUniformsCommand::getString()
+const std::string ShaderSetUniformsCommand::getString()
{
std::stringstream description;
- description << "SetUniformsCommand("
+ description << "ShaderSetUniformsCommand("
<< "shaderid=" << m_shaderid
<< "m_uniforms=[";
diff --git a/LayerManagerCommands/src/SurfaceCreateCommand.cpp b/LayerManagerCommands/src/SurfaceCreateCommand.cpp
new file mode 100644
index 0000000..f6a792c
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceCreateCommand.cpp
@@ -0,0 +1,70 @@
+/***************************************************************************
+*
+* 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 "SurfaceCreateCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceCreateCommand::SurfaceCreateCommand(unsigned int handle, PixelFormat pixelformat, uint OriginalWidth, uint OriginalHeight, uint* idReturn)
+: m_nativeHandle(handle)
+, m_pixelformat(pixelformat)
+, m_originalWidth(OriginalWidth)
+, m_originalHeight(OriginalHeight)
+, m_idReturn(idReturn)
+{
+}
+
+ExecutionResult SurfaceCreateCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.createSurface(*m_idReturn);
+
+ if (surface)
+ {
+ *m_idReturn = surface->getID();
+
+ surface->nativeHandle = m_nativeHandle;
+ surface->setPixelFormat(m_pixelformat);
+ surface->OriginalSourceWidth = m_originalWidth;
+ surface->OriginalSourceHeight = m_originalHeight;
+ surface->setDestinationRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
+ surface->setSourceRegion(Rectangle(0, 0, m_originalWidth, m_originalHeight));
+
+ LOG_DEBUG("CreateCommand", "Created surface with new id: " << surface->getID() << " handle " << m_nativeHandle << " pixelformat:" << m_pixelformat << " originalwidth:" << m_originalWidth<< " originalheighth:" << m_originalHeight);
+
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string SurfaceCreateCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceCreateCommand("
+ << "nativeHandle=" << m_nativeHandle
+ << ", pixelformat=" << m_pixelformat
+ << ", OriginalWidth=" << m_originalWidth
+ << ", OriginalHeight=" << m_originalHeight
+ << ", idReturn=" << m_idReturn << "=" << *m_idReturn
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceDumpCommand.cpp b/LayerManagerCommands/src/SurfaceDumpCommand.cpp
new file mode 100644
index 0000000..976bba8
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceDumpCommand.cpp
@@ -0,0 +1,80 @@
+/***************************************************************************
+ *
+ * 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 "SurfaceDumpCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceDumpCommand::SurfaceDumpCommand(char* givenfilename, unsigned int id)
+: m_filename(givenfilename)
+, m_id(id)
+{
+}
+
+ExecutionResult SurfaceDumpCommand::execute(ICommandExecutor* executor)
+{
+ ExecutionResult result = ExecutionFailed;
+ Scene& scene = *(executor->getScene());
+ RendererList& m_rendererList = *(executor->getRendererList());
+
+ bool status = false;
+ unsigned int layer_id = 0;
+
+ LOG_INFO("SurfaceDumpCommand","making screenshot, output file: " << m_filename);
+
+ if (scene.getSurface(m_id))
+ {
+ layer_id = scene.getSurface(m_id)->getContainingLayerId();
+ status = scene.isLayerInCurrentRenderOrder(layer_id);
+ if (!status)
+ {
+ LOG_WARNING("SurfaceDumpCommand","Requested surface: " << m_id << " does not belong to a layer which is part of the current render order");
+ }
+ }
+
+ if (status)
+ {
+ // call screen shot on all renderers for now TODO
+ RendererListConstIterator iter = m_rendererList.begin();
+ RendererListConstIterator iterEnd = m_rendererList.end();
+
+ for (; iter != iterEnd; ++iter)
+ {
+ IRenderer* renderer = *iter;
+
+ if (renderer)
+ {
+ renderer->doScreenShotOfSurface(m_filename, m_id, layer_id);
+ }
+ }
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceDumpCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceDumpCommand("
+ << "filename=" << m_filename
+ << ", id=" << m_id
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceGetDimensionCommand.cpp b/LayerManagerCommands/src/SurfaceGetDimensionCommand.cpp
new file mode 100644
index 0000000..d39f229
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceGetDimensionCommand.cpp
@@ -0,0 +1,64 @@
+/***************************************************************************
+ *
+ * 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 "SurfaceGetDimensionCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceGetDimensionCommand::SurfaceGetDimensionCommand(int id, uint* widthRet, uint* heightRet)
+: m_id(id)
+, m_pWidth(widthRet)
+, m_pHeight(heightRet)
+{
+}
+
+ExecutionResult SurfaceGetDimensionCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ Vector2 dim = surface->getDimension();
+ *m_pWidth = dim.val1;
+ *m_pHeight = dim.val2;
+ result = ExecutionSuccess;
+ }
+ else
+ {
+ *m_pWidth = 0;
+ *m_pHeight = 0;
+ }
+
+ return result;
+}
+
+const std::string SurfaceGetDimensionCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceGetDimensionCommand("
+ << "id=" << m_id
+ << ", pWidth=" << m_pWidth << "=" << *m_pWidth
+ << ", m_pHeight=" << m_pHeight << "=" << *m_pHeight
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceGetOpacityCommand.cpp b/LayerManagerCommands/src/SurfaceGetOpacityCommand.cpp
new file mode 100644
index 0000000..7a6805a
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceGetOpacityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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 "SurfaceGetOpacityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceGetOpacityCommand::SurfaceGetOpacityCommand(int id, double* returnOpacity)
+: m_id(id)
+, m_pReturnOpacity(returnOpacity)
+{
+}
+
+ExecutionResult SurfaceGetOpacityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ *m_pReturnOpacity = surface->getOpacity();
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string SurfaceGetOpacityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceGetOpacityCommand("
+ << "id=" << m_id
+ << ", pReturnOpacity=" << m_pReturnOpacity << "=" << *m_pReturnOpacity
+ << ")";
+ return description.str();
+}
+
diff --git a/LayerManagerCommands/src/SurfaceGetOrientationCommand.cpp b/LayerManagerCommands/src/SurfaceGetOrientationCommand.cpp
new file mode 100644
index 0000000..afaf251
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceGetOrientationCommand.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+ *
+ * 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 "SurfaceGetOrientationCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include <sstream>
+
+SurfaceGetOrientationCommand::SurfaceGetOrientationCommand(int id, OrientationType* orientation)
+: m_id(id)
+, m_pReturnOrientation(orientation)
+{
+}
+
+ExecutionResult SurfaceGetOrientationCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ *m_pReturnOrientation = surface->getOrientation();
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string SurfaceGetOrientationCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceGetOrientationCommand("
+ << "id=" << m_id
+ << ", pReturnOrientation=" << m_pReturnOrientation << "=" << *m_pReturnOrientation
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/GetPixelformatCommand.cpp b/LayerManagerCommands/src/SurfaceGetPixelformatCommand.cpp
index f12154c..3d1808a 100644
--- a/LayerManagerCommands/src/GetPixelformatCommand.cpp
+++ b/LayerManagerCommands/src/SurfaceGetPixelformatCommand.cpp
@@ -16,53 +16,38 @@
* limitations under the License.
*
****************************************************************************/
-#include "GetPixelformatCommand.h"
+#include "SurfaceGetPixelformatCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "Log.h"
-GetPixelformatCommand::GetPixelformatCommand(int id, ObjectType type, PixelFormat* f)
+SurfaceGetPixelformatCommand::SurfaceGetPixelformatCommand(int id, PixelFormat* f)
: m_id(id)
-, m_type(type)
, m_pFormatreturn(f)
{
}
-ExecutionResult GetPixelformatCommand::execute(ICommandExecutor* executor)
+ExecutionResult SurfaceGetPixelformatCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
ExecutionResult result = ExecutionFailed;
- switch(m_type)
- {
- case TypeSurface:
- {
- Surface* surface = scene.getSurface(m_id);
- if (surface)
- {
- *m_pFormatreturn = surface->getPixelFormat();
- result = ExecutionSuccess;
- }
- break;
- }
-
- case TypeLayer:
- case TypeSurfaceGroup:
- case TypeLayerGroup:
- default:
- break;
- }
+ Surface* surface = scene.getSurface(m_id);
+ if (surface)
+ {
+ *m_pFormatreturn = surface->getPixelFormat();
+ result = ExecutionSuccess;
+ }
return result;
}
-const std::string GetPixelformatCommand::getString()
+const std::string SurfaceGetPixelformatCommand::getString()
{
std::stringstream description;
- description << "GetPixelformatCommand("
+ description << "SurfaceGetPixelformatCommand("
<< "id=" << m_id
- << ", type=" << m_type
<< ", pFormatreturn=" << m_pFormatreturn << "=" << *m_pFormatreturn
<< ")";
return description.str();
diff --git a/LayerManagerCommands/src/SurfaceGetPositionCommand.cpp b/LayerManagerCommands/src/SurfaceGetPositionCommand.cpp
new file mode 100644
index 0000000..3e6c491
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceGetPositionCommand.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+*
+* 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 "SurfaceGetPositionCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceGetPositionCommand::SurfaceGetPositionCommand(int id, unsigned int* xRet, unsigned int* yRet)
+: m_id(id)
+, m_pX(xRet)
+, m_pY(yRet)
+{
+}
+
+ExecutionResult SurfaceGetPositionCommand::execute(ICommandExecutor* execute)
+{
+ Scene& scene = *(execute->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ Vector2 dim = surface->getPosition();
+ *m_pX = dim.val1;
+ *m_pY = dim.val2;
+ result = ExecutionSuccess;
+ }
+ else
+ {
+ *m_pX = 0;
+ *m_pY = 0;
+ }
+
+ return result;
+}
+
+const std::string SurfaceGetPositionCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceGetPositionCommand("
+ << "id=" << m_id
+ << ", pX=" << m_pX << "=" << *m_pX
+ << ", pY=" << m_pY << "=" << *m_pY
+ << ")";
+ return description.str();
+}
+
diff --git a/LayerManagerCommands/src/SurfaceGetVisibilityCommand.cpp b/LayerManagerCommands/src/SurfaceGetVisibilityCommand.cpp
new file mode 100644
index 0000000..f32b37a
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceGetVisibilityCommand.cpp
@@ -0,0 +1,57 @@
+/***************************************************************************
+*
+* 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 "SurfaceGetVisibilityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceGetVisibilityCommand::SurfaceGetVisibilityCommand(int id, bool* visibility)
+: m_id(id)
+, m_pVisibility(visibility)
+{
+}
+
+ExecutionResult SurfaceGetVisibilityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ LOG_DEBUG("SurfaceGetVisibilityCommand", "start of");
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ *m_pVisibility = surface->getVisibility();
+ LOG_DEBUG("SurfaceGetVisibilityCommand", "returned:" << *m_pVisibility);
+ result = ExecutionSuccess;
+ }
+ return result;
+}
+
+const std::string SurfaceGetVisibilityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceGetVisibilityCommand("
+ << "id=" << m_id
+ << ", pVisibility=" << m_pVisibility << "=" << *m_pVisibility
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceRemoveCommand.cpp b/LayerManagerCommands/src/SurfaceRemoveCommand.cpp
new file mode 100644
index 0000000..98624f1
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceRemoveCommand.cpp
@@ -0,0 +1,53 @@
+/***************************************************************************
+*
+* 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 "SurfaceRemoveCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+#include <sstream>
+
+SurfaceRemoveCommand::SurfaceRemoveCommand(unsigned int objectID)
+: m_idToRemove(objectID)
+{
+}
+
+ExecutionResult SurfaceRemoveCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_idToRemove);
+ if (surface)
+ {
+ scene.removeSurface(surface);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceRemoveCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceRemoveCommand("
+ << "idToRemove=" << m_idToRemove
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceSetDestinationRectangleCommand.cpp b/LayerManagerCommands/src/SurfaceSetDestinationRectangleCommand.cpp
new file mode 100644
index 0000000..9db666a
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetDestinationRectangleCommand.cpp
@@ -0,0 +1,63 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetDestinationRectangleCommand.h"
+#include "ICommandExecutor.h"
+#include "GraphicalSurface.h"
+#include "Scene.h"
+#include <sstream>
+
+SurfaceSetDestinationRectangleCommand::SurfaceSetDestinationRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
+: m_id(id)
+, m_x(x)
+, m_y(y)
+, m_width(width)
+, m_height(height)
+{
+}
+
+ExecutionResult SurfaceSetDestinationRectangleCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ const Rectangle rectangle(m_x, m_y, m_width, m_height);
+ surface->setDestinationRegion(rectangle);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceSetDestinationRectangleCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetDestinationRectangleCommand("
+ << "id=" << m_id
+ << ", x=" << m_x
+ << ", y=" << m_y
+ << ", width=" << m_width
+ << ", height=" << m_height
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceSetDimensionCommand.cpp b/LayerManagerCommands/src/SurfaceSetDimensionCommand.cpp
new file mode 100644
index 0000000..3dcef6c
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetDimensionCommand.cpp
@@ -0,0 +1,57 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetDimensionCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceSetDimensionCommand::SurfaceSetDimensionCommand(int id, unsigned int width,unsigned int height)
+: m_id(id)
+, m_width(width)
+, m_height(height)
+{
+}
+
+ExecutionResult SurfaceSetDimensionCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ GraphicalSurface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ surface->setDimension(m_width, m_height);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceSetDimensionCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetDimensionCommand("
+ << "id=" << m_id
+ << ", width=" << m_width
+ << ", height=" << m_height
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceSetOpacityCommand.cpp b/LayerManagerCommands/src/SurfaceSetOpacityCommand.cpp
new file mode 100644
index 0000000..5e45f72
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetOpacityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetOpacityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceSetOpacityCommand::SurfaceSetOpacityCommand(unsigned int id, double Opacity)
+: m_id(id)
+, m_opacity(Opacity)
+{
+}
+
+ExecutionResult SurfaceSetOpacityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ LOG_DEBUG("SurfaceSetOpacityCommand","new opacity " << m_opacity << " for id: " << m_id);
+ surface->setOpacity(m_opacity);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceSetOpacityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetOpacityCommand("
+ << "id=" << m_id
+ << ", opacity=" << m_opacity
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceSetOrientationCommand.cpp b/LayerManagerCommands/src/SurfaceSetOrientationCommand.cpp
new file mode 100644
index 0000000..172c6fb
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetOrientationCommand.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetOrientationCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceSetOrientationCommand::SurfaceSetOrientationCommand(unsigned int id, OrientationType Orientation)
+: m_id(id)
+, m_orientation(Orientation)
+{
+}
+
+ExecutionResult SurfaceSetOrientationCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ surface->setOrientation(m_orientation);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceSetOrientationCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetOrientationCommand("
+ << "id=" << m_id
+ << ", orientation=" << m_orientation
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceSetPositionCommand.cpp b/LayerManagerCommands/src/SurfaceSetPositionCommand.cpp
new file mode 100644
index 0000000..ce144a0
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetPositionCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetPositionCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceSetPositionCommand::SurfaceSetPositionCommand(unsigned int id, unsigned int x, unsigned int y )
+: m_id(id)
+, m_x(x)
+, m_y(y)
+{
+}
+
+ExecutionResult SurfaceSetPositionCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ surface->setPosition(m_x, m_y);
+ result = ExecutionSuccessRedraw;
+ }
+ return result;
+}
+
+const std::string SurfaceSetPositionCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetPositionCommand("
+ << "id=" << m_id
+ << ", m_x=" << m_x
+ << ", m_y=" << m_y
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SetShaderCommand.cpp b/LayerManagerCommands/src/SurfaceSetShaderCommand.cpp
index 1409482..13b771d 100644
--- a/LayerManagerCommands/src/SetShaderCommand.cpp
+++ b/LayerManagerCommands/src/SurfaceSetShaderCommand.cpp
@@ -16,29 +16,29 @@
* limitations under the License.
*
****************************************************************************/
-#include "SetShaderCommand.h"
+#include "SurfaceSetShaderCommand.h"
#include "ICommandExecutor.h"
#include "Scene.h"
#include "ShaderMap.h"
#include "Log.h"
-SetShaderCommand::SetShaderCommand(unsigned int id,unsigned int shaderid)
+SurfaceSetShaderCommand::SurfaceSetShaderCommand(unsigned int id,unsigned int shaderid)
: m_id(id)
, m_shaderid(shaderid)
{
}
-unsigned int SetShaderCommand::getID() const
+unsigned int SurfaceSetShaderCommand::getID() const
{
return m_id;
}
-unsigned int SetShaderCommand::getShaderID() const
+unsigned int SurfaceSetShaderCommand::getShaderID() const
{
return m_shaderid;
}
-ExecutionResult SetShaderCommand::execute(ICommandExecutor* executor)
+ExecutionResult SurfaceSetShaderCommand::execute(ICommandExecutor* executor)
{
Scene& scene = *(executor->getScene());
@@ -70,22 +70,22 @@ ExecutionResult SetShaderCommand::execute(ICommandExecutor* executor)
else
{
// shader not found
- LOG_ERROR("Layermanager", "shader ID " << m_shaderid << " not found");
+ LOG_ERROR("SurfaceSetShaderCommand", "shader ID " << m_shaderid << " not found");
}
}
else
{
// object not found
- LOG_ERROR("Layermanager", "object ID " << m_id << " not found");
+ LOG_ERROR("SurfaceSetShaderCommand", "object ID " << m_id << " not found");
}
return result;
}
-const std::string SetShaderCommand::getString()
+const std::string SurfaceSetShaderCommand::getString()
{
std::stringstream description;
- description << "SetShaderCommand("
+ description << "SurfaceSetShaderCommand("
<< "id=" << m_id
<< ", shaderid=" << m_shaderid
<< ")";
diff --git a/LayerManagerCommands/src/SurfaceSetSourceRectangleCommand.cpp b/LayerManagerCommands/src/SurfaceSetSourceRectangleCommand.cpp
new file mode 100644
index 0000000..24b4cbb
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetSourceRectangleCommand.cpp
@@ -0,0 +1,62 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetSourceRectangleCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceSetSourceRectangleCommand::SurfaceSetSourceRectangleCommand(int id, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
+: m_id(id)
+, m_x(x)
+, m_y(y)
+, m_width(width)
+, m_height(height)
+{
+}
+
+ExecutionResult SurfaceSetSourceRectangleCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_id);
+
+ if (surface)
+ {
+ const Rectangle rectangle(m_x, m_y, m_width, m_height);
+ surface->setSourceRegion(rectangle);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceSetSourceRectangleCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetSourceRectangleCommand("
+ << "id=" << m_id
+ << ", x=" << m_x
+ << ", y=" << m_y
+ << ", width=" << m_width
+ << ", height=" << m_height
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfaceSetVisibilityCommand.cpp b/LayerManagerCommands/src/SurfaceSetVisibilityCommand.cpp
new file mode 100644
index 0000000..7ef15eb
--- /dev/null
+++ b/LayerManagerCommands/src/SurfaceSetVisibilityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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 "SurfaceSetVisibilityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfaceSetVisibilityCommand::SurfaceSetVisibilityCommand(const uint givenid, bool newvisibility)
+: m_idtoSet(givenid)
+, m_visibility(newvisibility)
+{
+}
+
+ExecutionResult SurfaceSetVisibilityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ Surface* surface = scene.getSurface(m_idtoSet);
+
+ if (surface)
+ {
+ LOG_DEBUG("SurfaceSetVisibilityCommand", "setting visibility: " << m_visibility << " of id " << m_idtoSet);
+ surface->setVisibility(m_visibility);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfaceSetVisibilityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfaceSetVisibilityCommand("
+ << "idtoSet=" << m_idtoSet
+ << ", visibility=" << m_visibility
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfacegroupCreateCommand.cpp b/LayerManagerCommands/src/SurfacegroupCreateCommand.cpp
new file mode 100644
index 0000000..920bc53
--- /dev/null
+++ b/LayerManagerCommands/src/SurfacegroupCreateCommand.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+*
+* 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"
+
+SurfacegroupCreateCommand::SurfacegroupCreateCommand(uint* idReturn)
+: m_idReturn(idReturn)
+{
+}
+
+ExecutionResult SurfacegroupCreateCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+ ExecutionResult result = ExecutionFailed;
+
+ SurfaceGroup *surfacegroup = scene.createSurfaceGroup(*m_idReturn);
+
+ 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();
+}
diff --git a/LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp b/LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp
new file mode 100644
index 0000000..694917e
--- /dev/null
+++ b/LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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 "SurfacegroupGetOpacityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfacegroupGetOpacityCommand::SurfacegroupGetOpacityCommand(int id, double* returnOpacity)
+: m_id(id)
+, m_pReturnOpacity(returnOpacity)
+{
+}
+
+ExecutionResult SurfacegroupGetOpacityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_id);
+
+ if (surfacegroup)
+ {
+ *m_pReturnOpacity = surfacegroup->getOpacity();
+ result = ExecutionSuccess;
+ }
+
+ return result;
+}
+
+const std::string SurfacegroupGetOpacityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfacegroupGetOpacityCommand("
+ << "id=" << m_id
+ << ", pReturnOpacity=" << m_pReturnOpacity << "=" << *m_pReturnOpacity
+ << ")";
+ return description.str();
+}
+
diff --git a/LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp b/LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp
new file mode 100644
index 0000000..8a5e183
--- /dev/null
+++ b/LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp
@@ -0,0 +1,57 @@
+/***************************************************************************
+*
+* 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 "SurfacegroupGetVisibilityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+SurfacegroupGetVisibilityCommand::SurfacegroupGetVisibilityCommand(int id,bool* visibility)
+: m_id(id)
+, m_pVisibility(visibility)
+{
+}
+
+ExecutionResult SurfacegroupGetVisibilityCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ LOG_DEBUG("SurfacegroupGetVisibilityCommand", "start of");
+
+ ExecutionResult result = ExecutionFailed;
+
+ SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_id);
+
+ if (surfacegroup)
+ {
+ *m_pVisibility = surfacegroup->getVisibility();
+ LOG_DEBUG("SurfacegroupGetVisibilityCommand", "returned:" << *m_pVisibility);
+ result = ExecutionSuccess;
+ }
+ return result;
+}
+
+const std::string SurfacegroupGetVisibilityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfacegroupGetVisibilityCommand("
+ << "id=" << m_id
+ << ", pVisibility=" << m_pVisibility << "=" << *m_pVisibility
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfacegroupRemoveCommand.cpp b/LayerManagerCommands/src/SurfacegroupRemoveCommand.cpp
new file mode 100644
index 0000000..130b5be
--- /dev/null
+++ b/LayerManagerCommands/src/SurfacegroupRemoveCommand.cpp
@@ -0,0 +1,53 @@
+/***************************************************************************
+*
+* 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>
+
+SurfacegroupRemoveCommand::SurfacegroupRemoveCommand(unsigned int objectID)
+: m_idToRemove(objectID)
+{
+}
+
+ExecutionResult SurfacegroupRemoveCommand::execute(ICommandExecutor* executor)
+{
+ Scene& scene = *(executor->getScene());
+
+ ExecutionResult result = ExecutionFailed;
+
+ SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_idToRemove);
+ if (surfacegroup)
+ {
+ scene.removeSurfaceGroup(surfacegroup);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfacegroupRemoveCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfacegroupRemoveCommand("
+ << "idToRemove=" << m_idToRemove
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfacegroupSetOpacityCommand.cpp b/LayerManagerCommands/src/SurfacegroupSetOpacityCommand.cpp
new file mode 100644
index 0000000..7f4e065
--- /dev/null
+++ b/LayerManagerCommands/src/SurfacegroupSetOpacityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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"
+
+SurfacegroupSetOpacityCommand::SurfacegroupSetOpacityCommand(unsigned int id, double Opacity)
+: m_id(id)
+, m_opacity(Opacity)
+{
+}
+
+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);
+ surfacegroup->setOpacity(m_opacity);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfacegroupSetOpacityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfacegroupSetOpacityCommand("
+ << "id=" << m_id
+ << ", opacity=" << m_opacity
+ << ")";
+ return description.str();
+}
diff --git a/LayerManagerCommands/src/SurfacegroupSetVisibilityCommand.cpp b/LayerManagerCommands/src/SurfacegroupSetVisibilityCommand.cpp
new file mode 100644
index 0000000..a0bc152
--- /dev/null
+++ b/LayerManagerCommands/src/SurfacegroupSetVisibilityCommand.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+*
+* 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"
+
+SurfacegroupSetVisibilityCommand::SurfacegroupSetVisibilityCommand(const uint givenid, bool newvisibility)
+: m_idtoSet(givenid)
+, m_visibility(newvisibility)
+{
+}
+
+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);
+ surfacegroup->setVisibility(m_visibility);
+ result = ExecutionSuccessRedraw;
+ }
+
+ return result;
+}
+
+const std::string SurfacegroupSetVisibilityCommand::getString()
+{
+ std::stringstream description;
+ description << "SurfacegroupSetVisibilityCommand("
+ << "idtoSet=" << m_idtoSet
+ << ", visibility=" << m_visibility
+ << ")";
+ return description.str();
+}