LayerManagerCommands: log screen/layer/surface IDs in decimal and hex
[profile/ivi/layer-management.git] / LayerManagerCommands / src / SurfaceUpdateInputEventAcceptance.cpp
1 /***************************************************************************
2 *
3 * Copyright 2012 Valeo
4 *
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *        http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 *****************************************************************************/
19
20 #include <sstream>
21
22 #include "RendererList.h"
23 #include "SurfaceUpdateInputEventAcceptance.h"
24 #include "ICommandExecutor.h"
25 #include "InputManager.h"
26
27 ExecutionResult SurfaceUpdateInputEventAcceptance::execute(ICommandExecutor* executor)
28 {
29     RendererList* rList;
30     ExecutionResult result;
31     RendererListConstIterator it;
32
33     result = ExecutionSuccess;
34     rList = executor->getRendererList();
35     for (it = rList->begin(); (it != rList->end()) && (result == ExecutionSuccess); it++)
36     {
37         result = (*it)->getInputManager()->updateInputEventAcceptanceOn(m_surfId, m_devices, m_accept) ? ExecutionSuccess : ExecutionFailed;
38     }
39
40     return ExecutionSuccess;
41 }
42
43 const std::string SurfaceUpdateInputEventAcceptance::getString()
44 {
45     std::stringstream description;
46
47     description << "SurfaceUpdateInputEventAcceptance("
48                 << "m_surfId=" << m_surfId << "(0x" << std::hex << m_surfId << ")" << std::dec
49                 << ")";
50     return description.str();
51 }
52
53