<commit_before>#pragma once

#include <functional>

namespace storm {

class Mouse {
public:
    enum class Button {
        Left,
        Right,
        Middle,
        SideFirst,
        SideSecond
    };

    struct Movement {
        int x;
        int y;
    };

    struct CursorPosition {
        int x;
        int y;
    };

    struct Observer {
        std::function<void(Button)> onButtonPress;
        std::function<void(Button)> onButtonRelease;
        std::function<void(int)> onWheelRotation;
        std::function<void(Movement)> onMovement;
        std::function<void(Movement, CursorPosition)> onCursorMovement;
    };

    static Mouse* getInstance();

    virtual ~Mouse() {}

    virtual void addObserver( const Observer* ) = 0;
    virtual void removeObserver( const Observer* ) = 0;

    virtual bool isButtonPressed( Button ) const = 0;

    virtual bool getCursorVisibility() const = 0;
    virtual void setCursorVisibility( bool ) = 0;

    virtual bool getCursorMovementRestriction() const = 0;
    virtual void setCursorMovementRestriction( bool ) = 0;

    virtual CursorPosition getCursorPosition() const = 0;
};

struct ScopedMouseObserver : Mouse::Observer {
    ScopedMouseObserver() {
        Mouse::getInstance()->addObserver( this );
    }
    ~ScopedMouseObserver() {
        Mouse::getInstance()->removeObserver( this );
    }
    ScopedMouseObserver( const ScopedMouseObserver& ) = delete;
    ScopedMouseObserver& operator = ( const ScopedMouseObserver& ) = delete;
};

}
<commit_msg>Replaced mouse cursor related types with IntVector2d<commit_after>#pragma once

#include <functional>

#include <storm/vector.h>

namespace storm {

class Mouse {
public:
    enum class Button {
        Left,
        Right,
        Middle,
        SideFirst,
        SideSecond
    };

    using Movement = IntVector2d;
    using CursorPosition = IntVector2d;

    struct Observer {
        std::function<void(Button)> onButtonPress;
        std::function<void(Button)> onButtonRelease;
        std::function<void(int)> onWheelRotation;
        std::function<void(Movement)> onMovement;
        std::function<void(Movement, CursorPosition)> onCursorMovement;
    };

    static Mouse* getInstance();

    virtual ~Mouse() {}

    virtual void addObserver( const Observer* ) = 0;
    virtual void removeObserver( const Observer* ) = 0;

    virtual bool isButtonPressed( Button ) const = 0;

    virtual bool getCursorVisibility() const = 0;
    virtual void setCursorVisibility( bool ) = 0;

    virtual bool getCursorMovementRestriction() const = 0;
    virtual void setCursorMovementRestriction( bool ) = 0;

    virtual CursorPosition getCursorPosition() const = 0;
};

struct ScopedMouseObserver : Mouse::Observer {
    ScopedMouseObserver() {
        Mouse::getInstance()->addObserver( this );
    }
    ~ScopedMouseObserver() {
        Mouse::getInstance()->removeObserver( this );
    }
    ScopedMouseObserver( const ScopedMouseObserver& ) = delete;
    ScopedMouseObserver& operator = ( const ScopedMouseObserver& ) = delete;
};

}

{'fraction_non_alphanumeric': 0.10205412455167917, 'fraction_numerical': 0.006194978806651451, 'mean_word_length': 3.1292059219380888, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 20, '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': '1318343', 'n_tokens_mistral': 884, 'n_tokens_neox': 835, 'n_words': 218}