1 /***************************************************************************
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 ****************************************************************************/
22 #include "RendererList.h"
23 #include "SurfaceSetKeyboardFocusCommand.h"
24 #include "ICommandExecutor.h"
25 #include "InputManager.h"
27 ExecutionResult SurfaceSetKeyboardFocusCommand::execute(ICommandExecutor* executor)
30 ExecutionResult result;
31 RendererListConstIterator it;
33 result = ExecutionSuccess;
34 rList = executor->getRendererList();
35 for (it = rList->begin(); (it != rList->end()) && (result == ExecutionSuccess); it++)
37 result = (*it)->getInputManager()->setKeyboardFocusOn(m_surfId) ? ExecutionSuccess : ExecutionFailed;
43 const std::string SurfaceSetKeyboardFocusCommand::getString()
45 std::stringstream description;
47 description << "SurfaceSetKeyboardFocusCommand("
48 << "m_surfId=" << m_surfId << "(0x" << std::hex << m_surfId << ")" << std::dec
50 return description.str();