<commit_before>/******************************************************************************
 * This file is part of the Gluon Development Platform
 * Copyright (C) 2010 <NAME> <<EMAIL>>
 * Copyright (c) 2010 <NAME> <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */


#ifndef KEYBOARDINPUTCOMPONENT_H
#define KEYBOARDINPUTCOMPONENT_H

#include "component.h"

#include "gluonbuttons.h"

namespace GluonInput {
    class Mouse;
}

namespace GluonEngine
{
    class MouseInputComponent : public Component
    {
            Q_OBJECT;
            GLUON_OBJECT(GluonEngine::MouseInputComponent)
            Q_INTERFACES(GluonEngine::Component)
            Q_PROPERTY(MouseButton mouseButton READ mouseButton WRITE setMouseButton)
            Q_ENUMS(MouseButton)

        public:
            enum MouseButton
            {
                MOUSE_BUTTON_UNKNOWN,
                MOUSE_BUTTON_LEFT,
                MOUSE_BUTTON_RIGHT,
                MOUSE_BUTTON_MIDDLE,
                MOUSE_BUTTON_FOUR,
                MOUSE_BUTTON_FIVE,
                MOUSE_BUTTON_SIX,
                MOUSE_BUTTON_SEVEN,
                MOUSE_BUTTON_EIGHT,
            };

            Q_INVOKABLE MouseInputComponent(QObject *parent = 0);
            virtual QString category() const;

            // True on any frame between getActionStarted and
            // getActionStopped, inclusive of those two frames
            Q_INVOKABLE bool isActionHeld();
            // True on the frame when an action was begun (for example the
            // button represented by buttonName was pressed on a controller)
            Q_INVOKABLE bool isActionStarted();
            // True on the frame when an action was stopped (for example a
            // button was released on a controller)
            Q_INVOKABLE bool isActionStopped();

            virtual void initialize();
            virtual void start();
            virtual void update(int elapsedMilliseconds);
            virtual void stop();

            MouseButton mouseButton() const;
            void setMouseButton(MouseButton button);

            Q_INVOKABLE virtual int xAxis();
            Q_INVOKABLE virtual int yAxis();
            Q_INVOKABLE virtual int zAxis();

            Q_INVOKABLE virtual int relativeXAxis();
            Q_INVOKABLE virtual int relativeYAxis();
            Q_INVOKABLE virtual int relativeZAxis();

        private:
            class MouseInputComponentPrivate;
            MouseInputComponentPrivate *const d;
    };
}

Q_DECLARE_METATYPE(GluonEngine::MouseInputComponent)
Q_DECLARE_METATYPE(GluonEngine::MouseInputComponent*)

#endif // KEYBOARDINPUTCOMPONENT_H
<commit_msg>Fix the Keyboard entry (defines, ifndef) in the mouse input component.<commit_after>/******************************************************************************
 * This file is part of the Gluon Development Platform
 * Copyright (C) 2010 <NAME> <<EMAIL>>
 * Copyright (c) 2010 <NAME> <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */


#ifndef MOUSEINPUTCOMPONENT_H
#define MOUSEINPUTCOMPONENT_H

#include "component.h"

#include "gluonbuttons.h"

namespace GluonInput {
    class Mouse;
}

namespace GluonEngine
{
    class MouseInputComponent : public Component
    {
            Q_OBJECT;
            GLUON_OBJECT(GluonEngine::MouseInputComponent)
            Q_INTERFACES(GluonEngine::Component)
            Q_PROPERTY(MouseButton mouseButton READ mouseButton WRITE setMouseButton)
            Q_ENUMS(MouseButton)

        public:
            enum MouseButton
            {
                MOUSE_BUTTON_UNKNOWN,
                MOUSE_BUTTON_LEFT,
                MOUSE_BUTTON_RIGHT,
                MOUSE_BUTTON_MIDDLE,
                MOUSE_BUTTON_FOUR,
                MOUSE_BUTTON_FIVE,
                MOUSE_BUTTON_SIX,
                MOUSE_BUTTON_SEVEN,
                MOUSE_BUTTON_EIGHT,
            };

            Q_INVOKABLE MouseInputComponent(QObject *parent = 0);
            virtual QString category() const;

            // True on any frame between getActionStarted and
            // getActionStopped, inclusive of those two frames
            Q_INVOKABLE bool isActionHeld();
            // True on the frame when an action was begun (for example the
            // button represented by buttonName was pressed on a controller)
            Q_INVOKABLE bool isActionStarted();
            // True on the frame when an action was stopped (for example a
            // button was released on a controller)
            Q_INVOKABLE bool isActionStopped();

            virtual void initialize();
            virtual void start();
            virtual void update(int elapsedMilliseconds);
            virtual void stop();

            MouseButton mouseButton() const;
            void setMouseButton(MouseButton button);

            Q_INVOKABLE virtual int xAxis();
            Q_INVOKABLE virtual int yAxis();
            Q_INVOKABLE virtual int zAxis();

            Q_INVOKABLE virtual int relativeXAxis();
            Q_INVOKABLE virtual int relativeYAxis();
            Q_INVOKABLE virtual int relativeZAxis();

        private:
            class MouseInputComponentPrivate;
            MouseInputComponentPrivate *const d;
    };
}

Q_DECLARE_METATYPE(GluonEngine::MouseInputComponent)
Q_DECLARE_METATYPE(GluonEngine::MouseInputComponent*)

#endif // MOUSEINPUTCOMPONENT_H

{'fraction_non_alphanumeric': 0.08005908419497784, 'fraction_numerical': 0.006499261447562777, 'mean_word_length': 2.4794450154162386, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3398622', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1720, 'n_words': 606}