LayerManagerCommands: removed obsolete Commands
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Tue, 14 Feb 2012 13:22:05 +0000 (14:22 +0100)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Tue, 6 Mar 2012 16:50:05 +0000 (17:50 +0100)
removed LayergroupGet* and SurfacegroupGet* commands,
because their behaviour is undefined, if members of the
groups have different values for visibility or opacity.

LayerManagerCommands/include/LayergroupGetOpacityCommand.h [deleted file]
LayerManagerCommands/include/LayergroupGetVisibilityCommand.h [deleted file]
LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h [deleted file]
LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h [deleted file]
LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp [deleted file]
LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp [deleted file]
LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp [deleted file]
LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp [deleted file]
LayerManagerPlugins/Communicators/DBUSCommunicator/include/DBUSCommunicator.h
LayerManagerPlugins/Communicators/DBUSCommunicator/src/DBUSCommunicator.cpp

diff --git a/LayerManagerCommands/include/LayergroupGetOpacityCommand.h b/LayerManagerCommands/include/LayergroupGetOpacityCommand.h
deleted file mode 100644 (file)
index 52aa4e7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-
-#ifndef _LAYERGROUPGETOPACITYCOMMAND_H_
-#define _LAYERGROUPGETOPACITYCOMMAND_H_
-
-#include "BaseCommandSynchronous.h"
-
-
-class LayergroupGetOpacityCommand : public BaseCommandSynchronous
-{
-public:
-    LayergroupGetOpacityCommand(int id, double* returnOpacity);
-    virtual ~LayergroupGetOpacityCommand() {}
-
-    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> friend class LayergroupGetOpacityCommandEqMatcherP;
-};
-
-
-#endif /* _LAYERGROUPGETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h b/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h
deleted file mode 100644 (file)
index 8834bd0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-
-#ifndef _LAYERGROUPGETVISIBILITYCOMMAND_H_
-#define _LAYERGROUPGETVISIBILITYCOMMAND_H_
-
-#include "BaseCommandSynchronous.h"
-
-class LayergroupGetVisibilityCommand : public BaseCommandSynchronous
-{
-public:
-    LayergroupGetVisibilityCommand(int id, bool* visibility);
-    virtual ~LayergroupGetVisibilityCommand() {}
-
-    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> friend class LayergroupGetVisibilityCommandEqMatcherP;
-};
-
-
-#endif /* _LAYERGROUPGETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h b/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h
deleted file mode 100644 (file)
index c8c4866..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-
-#ifndef _SURFACEGROUPGETOPACITYCOMMAND_H_
-#define _SURFACEGROUPGETOPACITYCOMMAND_H_
-
-#include "BaseCommandSynchronous.h"
-
-
-class SurfacegroupGetOpacityCommand : public BaseCommandSynchronous
-{
-public:
-    SurfacegroupGetOpacityCommand(int id, double* returnOpacity);
-    virtual ~SurfacegroupGetOpacityCommand() {}
-
-    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> friend class SurfacegroupGetOpacityCommandEqMatcherP;
-};
-
-
-#endif /* _SURFACEGROUPGETOPACITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h b/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h
deleted file mode 100644 (file)
index 8fe6382..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-
-#ifndef _SURFACEGROUPGETVISIBILITYCOMMAND_H_
-#define _SURFACEGROUPGETVISIBILITYCOMMAND_H_
-
-#include "BaseCommandSynchronous.h"
-
-class SurfacegroupGetVisibilityCommand : public BaseCommandSynchronous
-{
-public:
-    SurfacegroupGetVisibilityCommand(int id, bool* visibility);
-    virtual ~SurfacegroupGetVisibilityCommand() {}
-
-    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> friend class SurfacegroupGetVisibilityCommandEqMatcherP;
-};
-
-
-#endif /* _SURFACEGROUPGETVISIBILITYCOMMAND_H_ */
diff --git a/LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp b/LayerManagerCommands/src/LayergroupGetOpacityCommand.cpp
deleted file mode 100644 (file)
index 199302f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "LayergroupGetOpacityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-LayergroupGetOpacityCommand::LayergroupGetOpacityCommand(int id, double* returnOpacity)
-: m_id(id)
-, m_pReturnOpacity(returnOpacity)
-{
-}
-
-ExecutionResult LayergroupGetOpacityCommand::execute(ICommandExecutor* executor)
-{
-    Scene& scene = *(executor->getScene());
-
-    ExecutionResult result = ExecutionFailed;
-
-    LayerGroup* layergroup = scene.getLayerGroup(m_id);
-
-    if (layergroup)
-    {
-        *m_pReturnOpacity = layergroup->getOpacity();
-        result = ExecutionSuccess;
-    }
-
-    return result;
-}
-
-const std::string LayergroupGetOpacityCommand::getString()
-{
-    std::stringstream description;
-    description << "LayergroupGetOpacityCommand("
-                << "id=" << m_id
-                << ", pReturnOpacity=" << m_pReturnOpacity << "=" << *m_pReturnOpacity
-                << ")";
-    return description.str();
-}
-
diff --git a/LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp b/LayerManagerCommands/src/LayergroupGetVisibilityCommand.cpp
deleted file mode 100644 (file)
index bf6c750..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "LayergroupGetVisibilityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-LayergroupGetVisibilityCommand::LayergroupGetVisibilityCommand(int id, bool* visibility)
-: m_id(id)
-, m_pVisibility(visibility)
-{
-}
-
-ExecutionResult LayergroupGetVisibilityCommand::execute(ICommandExecutor* executor)
-{
-    Scene& scene = *(executor->getScene());
-
-    LOG_DEBUG("LayergroupGetVisibilityCommand", "start of");
-
-    ExecutionResult result = ExecutionFailed;
-
-    LayerGroup* layergroup = scene.getLayerGroup(m_id);
-
-    if (layergroup)
-    {
-        *m_pVisibility = layergroup->getVisibility();
-        LOG_DEBUG("LayergroupGetVisibilityCommand", "returned:" << *m_pVisibility);
-        result = ExecutionSuccess;
-    }
-    return result;
-}
-
-const std::string LayergroupGetVisibilityCommand::getString()
-{
-    std::stringstream description;
-    description << "LayergroupGetVisibilityCommand("
-                << "id=" << m_id
-                << ", pVisibility=" << m_pVisibility << "=" << *m_pVisibility
-                << ")";
-    return description.str();
-}
diff --git a/LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp b/LayerManagerCommands/src/SurfacegroupGetOpacityCommand.cpp
deleted file mode 100644 (file)
index 694917e..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "SurfacegroupGetOpacityCommand.h"
-#include "ICommandExecutor.h"
-#include "Scene.h"
-#include "Log.h"
-
-SurfacegroupGetOpacityCommand::SurfacegroupGetOpacityCommand(int id, double* returnOpacity)
-: m_id(id)
-, m_pReturnOpacity(returnOpacity)
-{
-}
-
-ExecutionResult SurfacegroupGetOpacityCommand::execute(ICommandExecutor* executor)
-{
-    Scene& scene = *(executor->getScene());
-
-    ExecutionResult result = ExecutionFailed;
-
-    SurfaceGroup* surfacegroup = scene.getSurfaceGroup(m_id);
-
-    if (surfacegroup)
-    {
-        *m_pReturnOpacity = surfacegroup->getOpacity();
-        result = ExecutionSuccess;
-    }
-
-    return result;
-}
-
-const std::string SurfacegroupGetOpacityCommand::getString()
-{
-    std::stringstream description;
-    description << "SurfacegroupGetOpacityCommand("
-                << "id=" << m_id
-                << ", pReturnOpacity=" << m_pReturnOpacity << "=" << *m_pReturnOpacity
-                << ")";
-    return description.str();
-}
-
diff --git a/LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp b/LayerManagerCommands/src/SurfacegroupGetVisibilityCommand.cpp
deleted file mode 100644 (file)
index 8a5e183..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*        http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
-#include "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();
-}
index e91c1fd..1c9bb77 100644 (file)
 #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 "LayerRemoveCommand.h"
index 844ae14..21db4cc 100644 (file)
@@ -104,8 +104,6 @@ static MethodTable manager_methods[] =
     { "SetLayergroupOpacity",             "ud",    "",            &DBUSCommunicator::SetLayergroupOpacity },
     { "GetSurfaceOpacity",                "u",     "d",           &DBUSCommunicator::GetSurfaceOpacity },
     { "GetLayerOpacity",                  "u",     "d",           &DBUSCommunicator::GetLayerOpacity },
-    { "GetSurfacegroupOpacity",           "u",     "d",           &DBUSCommunicator::GetSurfacegroupOpacity },
-    { "GetLayergroupOpacity",             "u",     "d",           &DBUSCommunicator::GetLayergroupOpacity },
     { "SetSurfaceOrientation",            "uu",    "",            &DBUSCommunicator::SetSurfaceOrientation },
     { "GetSurfaceOrientation",            "uu",    "",            &DBUSCommunicator::GetSurfaceOrientation },
     { "SetLayerOrientation",              "uu",    "",            &DBUSCommunicator::SetLayerOrientation },
@@ -1473,48 +1471,6 @@ void DBUSCommunicator::GetLayerOpacity(DBusConnection* conn, DBusMessage* msg)
     }
 }
 
-void DBUSCommunicator::GetSurfacegroupOpacity(DBusConnection* conn, DBusMessage* msg)
-{
-    (void)conn; // TODO: remove, only prevents warning
-
-    g_pDbusMessage->initReceive(msg);
-    uint id = g_pDbusMessage->getUInt();
-    double param = 0.0;
-
-    bool status = m_executor->execute(new SurfacegroupGetOpacityCommand(id, &param));
-    if (status)
-    {
-        g_pDbusMessage->initReply(msg);
-        g_pDbusMessage->appendDouble(param);
-        g_pDbusMessage->closeReply();
-    }
-    else
-    {
-        g_pDbusMessage->ReplyError(msg, SERVICE_ERROR, RESSOURCE_NOT_FOUND);
-    }
-}
-
-void DBUSCommunicator::GetLayergroupOpacity(DBusConnection* conn, DBusMessage* msg)
-{
-    (void)conn; // TODO: remove, only prevents warning
-
-    g_pDbusMessage->initReceive(msg);
-    uint id = g_pDbusMessage->getUInt();
-    double param = 0.0;
-
-    bool status = m_executor->execute(new LayergroupGetOpacityCommand(id, &param));
-    if (status)
-    {
-        g_pDbusMessage->initReply(msg);
-        g_pDbusMessage->appendDouble(param);
-        g_pDbusMessage->closeReply();
-    }
-    else
-    {
-        g_pDbusMessage->ReplyError(msg, SERVICE_ERROR, RESSOURCE_NOT_FOUND);
-    }
-}
-
 void DBUSCommunicator::SetSurfaceOrientation(DBusConnection* conn, DBusMessage* msg)
 {
     (void)conn; // TODO: remove, only prevents warning