<commit_before>// Copyright (c) 2009 Sirikata Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.

#include "OgreSystemInputHandler.hpp"

#include "OgreSystem.hpp"
#include <sirikata/ogre/Camera.hpp>
#include <sirikata/ogre/Lights.hpp>
#include <sirikata/ogre/Entity.hpp>
#include <sirikata/proxyobject/ProxyManager.hpp>
#include <sirikata/proxyobject/ProxyObject.hpp>
#include <sirikata/ogre/input/InputEvents.hpp>

#include <sirikata/ogre/input/SDLInputDevice.hpp>
#include <sirikata/ogre/input/SDLInputManager.hpp>
#include <sirikata/ogre/input/InputManager.hpp>

#include <sirikata/core/task/Time.hpp>
#include <set>

#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>

#include <sirikata/ogre/OgreConversions.hpp>

#include "ProxyEntity.hpp"

namespace Sirikata {
namespace Graphics {
using namespace Input;
using namespace Task;
using namespace std;


// == WebViewInputListener ==

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onKeyEvent(Input::ButtonEventPtr ev) {
    return WebViewManager::getSingleton().onButton(ev);
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onAxisEvent(Input::AxisEventPtr axisev) {
    float multiplier = mParent->mParent->mInputManager->wheelToAxis();

    if (axisev->mAxis == SDLMouse::WHEELY) {
        bool used = WebViewManager::getSingleton().injectMouseWheel(WebViewCoord(0, axisev->mValue.getCentered()/multiplier));
        if (used)
            return EventResponse::cancel();
    }
    if (axisev->mAxis == SDLMouse::WHEELX) {
        bool used = WebViewManager::getSingleton().injectMouseWheel(WebViewCoord(axisev->mValue.getCentered()/multiplier, 0));
        if (used)
            return EventResponse::cancel();
    }

    return EventResponse::nop();
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onTextInputEvent(Input::TextInputEventPtr textev) {
    return WebViewManager::getSingleton().onKeyTextInput(textev);
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onMouseHoverEvent(Input::MouseHoverEventPtr mouseev) {
    return WebViewManager::getSingleton().onMouseHover(mouseev);
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onMousePressedEvent(Input::MousePressedEventPtr mouseev) {<commit_msg>Fix use of protected member of OgreSystem.<commit_after>// Copyright (c) 2009 Sirikata Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.

#include "OgreSystemInputHandler.hpp"

#include "OgreSystem.hpp"
#include <sirikata/ogre/Camera.hpp>
#include <sirikata/ogre/Lights.hpp>
#include <sirikata/ogre/Entity.hpp>
#include <sirikata/proxyobject/ProxyManager.hpp>
#include <sirikata/proxyobject/ProxyObject.hpp>
#include <sirikata/ogre/input/InputEvents.hpp>

#include <sirikata/ogre/input/SDLInputDevice.hpp>
#include <sirikata/ogre/input/SDLInputManager.hpp>
#include <sirikata/ogre/input/InputManager.hpp>

#include <sirikata/core/task/Time.hpp>
#include <set>

#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>

#include <sirikata/ogre/OgreConversions.hpp>

#include "ProxyEntity.hpp"

namespace Sirikata {
namespace Graphics {
using namespace Input;
using namespace Task;
using namespace std;


// == WebViewInputListener ==

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onKeyEvent(Input::ButtonEventPtr ev) {
    return WebViewManager::getSingleton().onButton(ev);
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onAxisEvent(Input::AxisEventPtr axisev) {
    float multiplier = mParent->mParent->getInputManager()->wheelToAxis();

    if (axisev->mAxis == SDLMouse::WHEELY) {
        bool used = WebViewManager::getSingleton().injectMouseWheel(WebViewCoord(0, axisev->mValue.getCentered()/multiplier));
        if (used)
            return EventResponse::cancel();
    }
    if (axisev->mAxis == SDLMouse::WHEELX) {
        bool used = WebViewManager::getSingleton().injectMouseWheel(WebViewCoord(axisev->mValue.getCentered()/multiplier, 0));
        if (used)
            return EventResponse::cancel();
    }

    return EventResponse::nop();
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onTextInputEvent(Input::TextInputEventPtr textev) {
    return WebViewManager::getSingleton().onKeyTextInput(textev);
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onMouseHoverEvent(Input::MouseHoverEventPtr mouseev) {
    return WebViewManager::getSingleton().onMouseHover(mouseev);
}

Input::EventResponse OgreSystemInputHandler::WebViewInputListener::onMousePressedEvent(Input::MousePressedEventPtr mouseev) {
{'fraction_non_alphanumeric': 0.12245326612056291, 'fraction_numerical': 0.002520478890989288, 'mean_word_length': 6.12874251497006, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2226278', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1514, 'n_words': 254}