ilmErrorTypes ilm_surfaceCreatePlaceholder(t_ilm_surface *pSurfaceId);
/**
- * \brief Associate the render buffer of an application with a placeholder surface
+ * \brief Set the render buffer of an application to be used as surface content
* \ingroup Surface
* \param[in] nativehandle The native windowsystem's handle for the surface
* \param[in] width The original width of the surface
* \return ILM_TRUE if the method call was successful
* \return ILM_FAILED if the client can not call the method on the service.
*/
-ilmErrorTypes ilm_surfaceAssociateRenderBuffer(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, t_ilm_surface surfaceId);
+ilmErrorTypes ilm_surfaceSetRenderBuffer(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, t_ilm_surface surfaceId);
/**
* \brief Remove a surface
return result;
}
-ilmErrorTypes ilm_surfaceAssociateRenderBuffer(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, t_ilm_surface surfaceId)
+ilmErrorTypes ilm_surfaceSetRenderBuffer(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, t_ilm_surface surfaceId)
{
ilmErrorTypes result = ILM_FAILED;
DBusMessage *message;
add_library(LayerManagerCommands SHARED ${LM_SOURCES})
-set(LIBS ${LIBS} LayerManagerUtils)
+set(LIBS ${LIBS} LayerManagerUtils)
target_link_libraries(LayerManagerCommands ${LIBS})
install (TARGETS LayerManagerCommands DESTINATION lib)
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
*
****************************************************************************/
-#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();
private:
std::string m_filename;
const unsigned int m_id;
- const ScreenShotType m_type;
};
-#endif /* _SCREENSHOTCOMMAND_H_ */
+#endif /* _LAYERDUMPCOMMAND_H_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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();
};
-#endif /* _SETORDERWITHINLAYERCOMMAND_H_ */
+#endif /* _LAYERSETRENDERORDERCOMMAND_H_ */
*
****************************************************************************/
-#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_ */
*
****************************************************************************/
-#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();
};
-#endif /* _SETLAYERTYPECOMMAND_H_ */
+#endif /* _LAYERSETTYPECOMMAND_H_ */
*
****************************************************************************/
-#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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _LAYERGROUPCREATECOMMAND_H_
+#define _LAYERGROUPCREATECOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _LAYERGROUPREMOVECOMMAND_H_
+#define _LAYERGROUPREMOVECOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _LAYERGROUPSETOPACITYCOMMAND_H_
+#define _LAYERGROUPSETOPACITYCOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _LAYERGROUPSETVISIBILITYCOMMAND_H_
+#define _LAYERGROUPSETVISIBILITYCOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#ifndef _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_ */
*
****************************************************************************/
-#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();
const unsigned int m_length;
};
-#endif /* _SETLAYERORDERCOMMAND_H_ */
+#endif /* _SCREENSETRENDERORDERCOMMAND_H_ */
*
****************************************************************************/
-#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();
unsigned int* m_returnID;
};
-#endif /* _CREATESHADERCOMMAND_H_ */
+#endif /* _SHADERCREATECOMMAND_H_ */
*
****************************************************************************/
-#ifndef _DESTROYSHADERCOMMAND_H_
-#define _DESTROYSHADERCOMMAND_H_
+#ifndef _SHADERDESTROYCOMMAND_H_
+#define _SHADERDESTROYCOMMAND_H_
#include "BaseCommandSynchronous.h"
#include "GraphicalObject.h"
#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();
const unsigned int m_id;
};
-#endif /* _DESTROYSHADERCOMMAND_H_ */
+#endif /* _SHADERDESTROYCOMMAND_H_ */
* 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();
const std::vector<std::string> m_uniforms;
};
-#endif /* _SETUNIFORMSCOMMAND_H_ */
+#endif /* _SHADERSETUNIFORMSCOMMAND_H_ */
*
****************************************************************************/
-#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;
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_ */
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#ifndef _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_ */
*
****************************************************************************/
-#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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
*
****************************************************************************/
-#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();
const unsigned int m_shaderid;
};
-#endif /* _SETSHADERCOMMAND_H_ */
+#endif /* _SURFACESETSHADERCOMMAND_H_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _SURFACEGROUPCREATECOMMAND_H_
+#define _SURFACEGROUPCREATECOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _SURFACEGROUPREMOVECOMMAND_H_
+#define _SURFACEGROUPREMOVECOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _SURFACEGROUPSETOPACITYCOMMAND_H_
+#define _SURFACEGROUPSETOPACITYCOMMAND_H_
+
+#include "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_ */
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+
+#ifndef _SURFACEGROUPSETVISIBILITYCOMMAND_H_
+#define _SURFACEGROUPSETVISIBILITYCOMMAND_H_
+
+#include "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_ */
+++ /dev/null
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "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();
-}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+#include "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();
+}
* 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;
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();
}
+
* 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();
* 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();
* 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;
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
<< ")";
* 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();
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
* 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)
{
}
-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
* 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
<< ")";
* 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();
* 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();
* 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
<< ")";
* 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());
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;
}
return result;
}
-const std::string SetOrderWithinLayerCommand::getString()
+const std::string LayerSetRenderOrderCommand::getString()
{
std::stringstream description;
- description << "SetOrderWithinLayerCommand("
+ description << "LayerSetRenderOrderCommand("
<< "layerid=" << m_layerid
<< ", m_array=[";
* 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)
{
}
-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
* 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());
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;
}
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
<< ")";
* 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();
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "LayergroupCreateCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
+
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "LayergroupRemoveCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+#include <sstream>
+
+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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "LayergroupSetOpacityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "LayergroupSetVisibilityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+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();
+}
+++ /dev/null
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "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();
-}
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+#include "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();
+}
* 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());
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;
}
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)
+++ /dev/null
-/***************************************************************************
- *
- * Copyright 2010,2011 BMW Car IT GmbH
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ****************************************************************************/
-#include "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();
-}
* 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());
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
<< ")";
* 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;
}
/// 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();
}
}
-void DestroyShaderCommand::removeShaderFromAllLayers(const LayerMap & layerMap, Shader *& shader)
+void ShaderDestroyCommand::removeShaderFromAllLayers(const LayerMap & layerMap, Shader *& shader)
{
LayerMapConstIterator iter = layerMap.begin();
LayerMapConstIterator iterEnd = layerMap.end();
}
}
-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("
* 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());
}
else
{
- LOG_ERROR("Layermanager", "Failed to parse uniform description");
+ LOG_ERROR("ShaderSetUniformsCommand", "Failed to parse uniform description");
result = ExecutionFailed;
}
}
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=[";
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
+
--- /dev/null
+/***************************************************************************
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+#include "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();
+}
* 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();
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
+
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
* 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());
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
<< ")";
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "SurfacegroupCreateCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
+
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "SurfacegroupRemoveCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+#include <sstream>
+
+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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "SurfacegroupSetOpacityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+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();
+}
--- /dev/null
+/***************************************************************************
+*
+* Copyright 2010,2011 BMW Car IT GmbH
+*
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+****************************************************************************/
+#include "SurfacegroupSetVisibilityCommand.h"
+#include "ICommandExecutor.h"
+#include "Scene.h"
+#include "Log.h"
+
+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();
+}
#ifndef _LAYERSCENE_PROVIDER_H_
#define _LAYERSCENE_PROVIDER_H_
-#include <string>
-#include "ICommandExecutor.h"
#include "ISceneProvider.h"
-#include "CommitCommand.h"
-#include "CreateCommand.h"
-#include "SetDestinationRectangleCommand.h"
-#include "SetSourceRectangleCommand.h"
-#include "SetVisibilityCommand.h"
-#include "SetOpacityCommand.h"
-#include "SetLayerOrderCommand.h"
-#include "ObjectType.h"
-#include "LayerScene.h"
+
+class ICommandExecutor;
+
/**
* scene Providers to setup a inital layer scenary on target platform
*/
* Delegate Scene : this method will be called on LayerManager startup
* to delegate a initial scene description of Layers on the target Platform
*/
- bool delegateScene();
+ virtual bool delegateScene();
};
****************************************************************************/
#include "LayerSceneProvider.h"
+#include "ICommandExecutor.h"
+#include "CommitCommand.h"
+#include "LayerCreateCommand.h"
+#include "LayerSetDestinationRectangleCommand.h"
+#include "LayerSetSourceRectangleCommand.h"
+#include "LayerSetVisibilityCommand.h"
+#include "LayerSetOpacityCommand.h"
+#include "ScreenSetRenderOrderCommand.h"
+#include "LayerScene.h"
+
LayerSceneProvider::LayerSceneProvider(ICommandExecutor* executor)
: ISceneProvider(executor)
int i = 0;
int numberOfLayers = sizeof(gInitialLayerScene) / sizeof (layerScene);
unsigned int *renderOrder = new unsigned int [numberOfLayers];
- unsigned int* screenResolution = m_executor->getScreenResolution(0);
+ unsigned int* screenResolution = m_executor->getScreenResolution(0);
if ( numberOfLayers > 0 )
{
/* setup inital layer scenery */
for (i = 0;i<numberOfLayers;i++)
{
- m_executor->execute(new CreateCommand(0, TypeLayer, PIXELFORMAT_R8, screenResolution[0], screenResolution[1], &(gInitialLayerScene[i].layer)));
- m_executor->execute(new SetSourceRectangleCommand(gInitialLayerScene[i].layer, TypeLayer, 0, 0, screenResolution[0], screenResolution[1]));
- m_executor->execute(new SetDestinationRectangleCommand(gInitialLayerScene[i].layer, TypeLayer, 0, 0, screenResolution[0], screenResolution[1]));
- m_executor->execute(new SetOpacityCommand(gInitialLayerScene[i].layer,TypeLayer,gInitialLayerScene[i].opacity) );
- m_executor->execute(new SetVisibilityCommand(gInitialLayerScene[i].layer,TypeLayer,gInitialLayerScene[i].visibility) );
- m_executor->execute(new CommitCommand());
+ m_executor->execute(new LayerCreateCommand(screenResolution[0], screenResolution[1], &(gInitialLayerScene[i].layer)));
+ m_executor->execute(new LayerSetSourceRectangleCommand(gInitialLayerScene[i].layer, 0, 0, screenResolution[0], screenResolution[1]));
+ m_executor->execute(new LayerSetDestinationRectangleCommand(gInitialLayerScene[i].layer, 0, 0, screenResolution[0], screenResolution[1]));
+ m_executor->execute(new LayerSetOpacityCommand(gInitialLayerScene[i].layer, gInitialLayerScene[i].opacity) );
+ m_executor->execute(new LayerSetVisibilityCommand(gInitialLayerScene[i].layer, gInitialLayerScene[i].visibility) );
+ m_executor->execute(new CommitCommand());
renderOrder[i]=gInitialLayerScene[i].layer;
}
/* Finally set the first executed renderorder */
- m_executor->execute(new SetLayerOrderCommand(renderOrder,numberOfLayers));
+ m_executor->execute(new ScreenSetRenderOrderCommand(renderOrder, numberOfLayers));
m_executor->execute(new CommitCommand());
}
return result;
#include "ICommandExecutor.h"
#include "CommitCommand.h"
-#include "CreateCommand.h"
-#include "GetDimensionCommand.h"
-#include "GetOpacityCommand.h"
-#include "GetPixelformatCommand.h"
-#include "GetVisibilityCommand.h"
+#include "LayerCreateCommand.h"
+#include "LayergroupCreateCommand.h"
+#include "SurfaceCreateCommand.h"
+#include "SurfacegroupCreateCommand.h"
+#include "SurfaceGetDimensionCommand.h"
+#include "LayerGetDimensionCommand.h"
+#include "SurfaceGetOpacityCommand.h"
+#include "LayerGetOpacityCommand.h"
+#include "SurfacegroupGetOpacityCommand.h"
+#include "LayergroupGetOpacityCommand.h"
+#include "SurfaceGetPixelformatCommand.h"
+#include "LayerGetVisibilityCommand.h"
+//#include "LayergroupGetVisibilityCommand.h"
+#include "SurfaceGetVisibilityCommand.h"
+//#include "SurfacegroupGetVisibilityCommand.h"
#include "LayerAddSurfaceCommand.h"
#include "LayerRemoveSurfaceCommand.h"
-#include "RemoveCommand.h"
-#include "GetOrientationCommand.h"
+#include "LayerRemoveCommand.h"
+#include "SurfaceRemoveCommand.h"
+#include "LayergroupRemoveCommand.h"
+#include "SurfacegroupRemoveCommand.h"
+#include "SurfaceGetOrientationCommand.h"
+#include "LayerGetOrientationCommand.h"
#include "LayergroupAddLayerCommand.h"
#include "LayergroupRemoveLayerCommand.h"
-#include "SetDestinationRectangleCommand.h"
-#include "SetOpacityCommand.h"
-#include "SetSourceRectangleCommand.h"
-#include "SetOrientationCommand.h"
+#include "LayerSetDestinationRectangleCommand.h"
+#include "SurfaceSetDestinationRectangleCommand.h"
+#include "LayerSetOpacityCommand.h"
+#include "LayergroupSetOpacityCommand.h"
+#include "SurfaceSetOpacityCommand.h"
+#include "SurfacegroupSetOpacityCommand.h"
+#include "LayerSetSourceRectangleCommand.h"
+#include "SurfaceSetSourceRectangleCommand.h"
+#include "LayerSetOrientationCommand.h"
+#include "SurfaceSetOrientationCommand.h"
#include "SurfacegroupAddSurfaceCommand.h"
#include "SurfacegroupRemoveSurfaceCommand.h"
-#include "SetVisibilityCommand.h"
+#include "LayerSetVisibilityCommand.h"
+#include "SurfaceSetVisibilityCommand.h"
+#include "LayergroupSetVisibilityCommand.h"
+#include "SurfacegroupSetVisibilityCommand.h"
#include "DebugCommand.h"
#include "ExitCommand.h"
-#include "SetLayerOrderCommand.h"
-#include "SetOrderWithinLayerCommand.h"
-#include "SetDimensionCommand.h"
-#include "SetPositionCommand.h"
-#include "GetPositionCommand.h"
-#include "CreateShaderCommand.h"
-#include "DestroyShaderCommand.h"
-#include "SetShaderCommand.h"
-#include "SetUniformsCommand.h"
-#include "ScreenShotCommand.h"
+#include "ScreenSetRenderOrderCommand.h"
+#include "LayerSetRenderOrderCommand.h"
+#include "LayerSetDimensionCommand.h"
+#include "SurfaceSetDimensionCommand.h"
+#include "LayerSetPositionCommand.h"
+#include "SurfaceSetPositionCommand.h"
+#include "LayerGetPositionCommand.h"
+#include "SurfaceGetPositionCommand.h"
+#include "ShaderCreateCommand.h"
+#include "ShaderDestroyCommand.h"
+#include "SurfaceSetShaderCommand.h"
+#include "ShaderSetUniformsCommand.h"
+#include "ScreenDumpCommand.h"
+#include "LayerDumpCommand.h"
+#include "SurfaceDumpCommand.h"
#include <dbus/dbus.h>
#include "DBUSTypes.h"
uint screenid = g_pDbusMessage->getUInt();
char* filename = g_pDbusMessage->getString();
- bool status = m_executor->execute(new ScreenShotCommand(filename, ScreenshotOfDisplay, screenid));
+ bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
if (status)
{
g_pDbusMessage->initReply(msg);
char* filename = g_pDbusMessage->getString();
uint layerid = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new ScreenShotCommand(filename, ScreenshotOfLayer, layerid));
+ bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
char* filename = g_pDbusMessage->getString();
uint id = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new ScreenShotCommand(filename, ScreenshotOfSurface, id));
+ bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
if (status)
{
g_pDbusMessage->initReply(msg);
uint pixelformat = g_pDbusMessage->getUInt();
PixelFormat pf = (PixelFormat) pixelformat;
- //LOG_DEBUG("DBUSCommunicator::CreateSurface","pixelformat: " << pixelformat);
uint id = GraphicalObject::INVALID_ID;
- bool status = m_executor->execute(new CreateCommand(handle, TypeSurface, pf, width, height, &id));
+ bool status = m_executor->execute(new SurfaceCreateCommand(handle, pf, width, height, &id));
if (status)
{
g_pDbusMessage->initReply(msg);
//LOG_DEBUG("DBUSCommunicator::CreateSurface","pixelformat: " << pixelformat);
uint id = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new CreateCommand(handle, TypeSurface, pf, width, height, &id));
+ bool status = m_executor->execute(new SurfaceCreateCommand(handle, pf, width, height, &id));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
uint param = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new RemoveCommand(param, TypeSurface));
+ bool status = m_executor->execute(new SurfaceRemoveCommand(param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = GraphicalObject::INVALID_ID;
// use resolution of default screen as default width and height of layers
uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
- bool status = m_executor->execute(new CreateCommand(0, TypeLayer, PIXELFORMAT_R8, resolution[0], resolution[1], &id));
+ bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
if (status)
{
g_pDbusMessage->initReply(msg);
id = g_pDbusMessage->getUInt();
// use resolution of default screen as default width and height of layers
uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
- bool status = m_executor->execute(new CreateCommand(0, TypeLayer, PIXELFORMAT_R8, resolution[0], resolution[1], &id));
+ bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
if (status)
{
g_pDbusMessage->initReply(msg);
uint height = g_pDbusMessage->getUInt();
uint id = GraphicalObject::INVALID_ID;
- bool status = m_executor->execute(new CreateCommand(0, TypeLayer, PIXELFORMAT_R8, width, height, &id));
+ bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
if (status)
{
g_pDbusMessage->initReply(msg);
id = g_pDbusMessage->getUInt();
uint width = g_pDbusMessage->getUInt();
uint height = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new CreateCommand(0, TypeLayer, PIXELFORMAT_R8, width, height, &id));
+ bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
uint param = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new RemoveCommand(param, TypeLayer));
+ bool status = m_executor->execute(new LayerRemoveCommand(param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint newID = GraphicalObject::INVALID_ID;
- bool status = m_executor->execute(new CreateCommand(0, TypeSurfaceGroup, PIXELFORMAT_R8, 0, 0, &newID));
+ bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
newID = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new CreateCommand(0, TypeSurfaceGroup, PIXELFORMAT_R8, 0, 0, &newID));
+ bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
uint param = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new RemoveCommand(param, TypeSurfaceGroup));
+ bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint newID = GraphicalObject::INVALID_ID;
- bool status = m_executor->execute(new CreateCommand(0, TypeLayerGroup, PIXELFORMAT_R8, 0, 0, &newID));
+ bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
newID = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new CreateCommand(0, TypeLayerGroup, PIXELFORMAT_R8, 0, 0, &newID));
+ bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
uint param = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new RemoveCommand(param, TypeLayerGroup));
+ bool status = m_executor->execute(new LayergroupRemoveCommand(param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint width = g_pDbusMessage->getUInt();
uint height = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetSourceRectangleCommand(id, TypeSurface, x, y, width, height));
+ bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint height = g_pDbusMessage->getUInt();
//LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
- bool status = m_executor->execute(new SetSourceRectangleCommand(id, TypeLayer, x, y, width, height));
+ bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint width = g_pDbusMessage->getUInt();
uint height = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetDestinationRectangleCommand(id, TypeSurface, x, y, width, height));
+ bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint x = g_pDbusMessage->getUInt();
uint y = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetPositionCommand(id, TypeSurface, x, y));
+ bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
if (status)
{
g_pDbusMessage->initReply(msg);
uint x = 0;
uint y = 0;
- bool status = m_executor->execute(new GetPositionCommand(id, TypeSurface, &x, &y));
+ bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
if (status)
{
g_pDbusMessage->initReply(msg);
uint width = g_pDbusMessage->getUInt();
uint height = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetDimensionCommand(id, TypeSurface, width, height));
+ bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint height = g_pDbusMessage->getUInt();
//LOG_DEBUG("DBUSCommunicator","new SetDestinationRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
- bool status = m_executor->execute(new SetDestinationRectangleCommand(id, TypeLayer, x, y, width, height));
+ bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint x = g_pDbusMessage->getUInt();
uint y = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetPositionCommand(id, TypeLayer, x, y));
+ bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
if (status)
{
g_pDbusMessage->initReply(msg);
uint x = 0;
uint y = 0;
- bool status = m_executor->execute(new GetPositionCommand(id, TypeLayer, &x, &y));
+ bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
if (status)
{
g_pDbusMessage->initReply(msg);
uint width = g_pDbusMessage->getUInt();
uint height = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetDimensionCommand(id, TypeLayer, width, height));
+ bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint width = 0;
uint height = 0;
- bool status = m_executor->execute(new GetDimensionCommand(id, TypeLayer, &width, &height));
+ bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint width = 0;
uint height = 0;
- bool status = m_executor->execute(new GetDimensionCommand(id, TypeSurface, &width, &height));
+ bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = g_pDbusMessage->getDouble();
- bool status = m_executor->execute(new SetOpacityCommand(id, TypeSurface, param));
+ bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = g_pDbusMessage->getDouble();
- bool status = m_executor->execute(new SetOpacityCommand(id, TypeLayer, param));
+ bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = g_pDbusMessage->getDouble();
- bool status = m_executor->execute(new SetOpacityCommand(id, TypeSurfaceGroup, param));
+ bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = g_pDbusMessage->getDouble();
- bool status = m_executor->execute(new SetOpacityCommand(id, TypeLayerGroup, param));
+ bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = 0.0;
- bool status = m_executor->execute(new GetOpacityCommand(id, TypeSurface, ¶m));
+ bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = 0.0;
- bool status = m_executor->execute(new GetOpacityCommand(id, TypeLayer, ¶m));
+ bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = 0.0;
- bool status = m_executor->execute(new GetOpacityCommand(id, TypeSurfaceGroup, ¶m));
+ bool status = m_executor->execute(new SurfacegroupGetOpacityCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
double param = 0.0;
- bool status = m_executor->execute(new GetOpacityCommand(id, TypeLayerGroup, ¶m));
+ bool status = m_executor->execute(new LayergroupGetOpacityCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
uint param = g_pDbusMessage->getUInt();
OrientationType o = (OrientationType) param;
- bool status = m_executor->execute(new SetOrientationCommand(id, TypeSurface, o));
+ bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
OrientationType o;
- bool status = m_executor->execute(new GetOrientationCommand(id, TypeSurface, &o));
+ bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
if (status)
{
g_pDbusMessage->initReply(msg);
uint param = g_pDbusMessage->getUInt();
OrientationType o = (OrientationType) param;
- bool status = m_executor->execute(new SetOrientationCommand(id, TypeLayer, o));
+ bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
OrientationType o;
- bool status = m_executor->execute(new GetOrientationCommand(id, TypeLayer, &o));
+ bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
PixelFormat param;
- bool status = m_executor->execute(new GetPixelformatCommand(id, TypeSurface, ¶m));
+ bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
const uint surfaceid = g_pDbusMessage->getUInt();
bool newVis = g_pDbusMessage->getBool();
- bool status = m_executor->execute(new SetVisibilityCommand(surfaceid, TypeSurface, newVis));
+ bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
if (status)
{
g_pDbusMessage->initReply(msg);
const uint layerid = g_pDbusMessage->getUInt();
bool myparam = g_pDbusMessage->getBool();
- bool status = m_executor->execute(new SetVisibilityCommand(layerid, TypeLayer, myparam));
+ bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
bool param;
- bool status = m_executor->execute(new GetVisibilityCommand(id, TypeSurface, ¶m));
+ bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
uint id = g_pDbusMessage->getUInt();
bool param;
- bool status = m_executor->execute(new GetVisibilityCommand(id, TypeLayer, ¶m));
+ bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
if (status)
{
g_pDbusMessage->initReply(msg);
uint groupid = g_pDbusMessage->getUInt();
bool myparam = g_pDbusMessage->getBool();
- bool status = m_executor->execute(new SetVisibilityCommand(groupid, TypeSurfaceGroup, myparam));
+ bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
if (status)
{
g_pDbusMessage->initReply(msg);
uint groupid = g_pDbusMessage->getUInt();
bool myparam = g_pDbusMessage->getBool();
- bool status = m_executor->execute(new SetVisibilityCommand(groupid, TypeLayerGroup, myparam));
+ bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
if (status)
{
g_pDbusMessage->initReply(msg);
//LOG_DEBUG("DBUSCommunicator","Renderorder: Got " << length << " ids.");
- bool status = m_executor->execute(new SetLayerOrderCommand(array, length));
+ bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->getArrayOfUInt(&length, &array);
- bool status = m_executor->execute(new SetOrderWithinLayerCommand(layerid, array, length));
+ bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
if (status)
{
g_pDbusMessage->initReply(msg);
char* fragname = g_pDbusMessage->getString();
uint id = 0;
- bool status = m_executor->execute(new CreateShaderCommand(vertname, fragname, &id));
+ bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->initReceive(msg);
uint shaderid = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new DestroyShaderCommand(shaderid));
+ bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
if (status)
{
g_pDbusMessage->initReply(msg);
(void)conn; // TODO: remove, only prevents warning
g_pDbusMessage->initReceive(msg);
- uint objectid = g_pDbusMessage->getUInt();
+ uint surfaceId = g_pDbusMessage->getUInt();
uint shaderid = g_pDbusMessage->getUInt();
- bool status = m_executor->execute(new SetShaderCommand(objectid, shaderid));
+ bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
if (status)
{
g_pDbusMessage->initReply(msg);
g_pDbusMessage->getArrayOfString(&uniforms);
- bool status = m_executor->execute(new SetUniformsCommand(id, uniforms));
+ bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
if (status)
{
g_pDbusMessage->initReply(msg);
#ifndef _ISCENE_PROVIDER_H_
#define _ISCENE_PROVIDER_H_
-#include <string>
-
+class ICommandExecutor;
/**
* Abstract Base Class for all Scene Providers to setup a inital layer Scenary
{
public:
/**
- * constructor: any sceneprovide need a executor for commands
+ * constructor: any sceneprovider need a executor for commands
* @param executor Pointer to an object to send commands to
*/
ISceneProvider(ICommandExecutor* executor);
: m_executor(executor)
{
}
+
#endif /* _ISCENE_PROVIDER_H_ */
// TODO: these should use public interface instead
friend class Layermanager;
friend class CommitCommand;
- friend class CreateShaderCommand;
- friend class DestroyShaderCommand;
- friend class SetShaderCommand;
- friend class SetUniformsCommand;
+ friend class ShaderCreateCommand;
+ friend class ShaderDestroyCommand;
+ friend class SurfaceSetShaderCommand;
+ friend class ShaderSetUniformsCommand;
public:
Scene();