Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad1eb836 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove getButtonState/setButtonState from PointerController" into udc-dev am: 10be070b

parents fb03beea 10be070b
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -53,8 +53,6 @@ MouseCursorController::MouseCursorController(PointerControllerContext& context)
    mLocked.resolvedPointerType = PointerIconStyle::TYPE_NOT_SPECIFIED;

    mLocked.resourcesLoaded = false;

    mLocked.buttonState = 0;
}

MouseCursorController::~MouseCursorController() {
@@ -95,22 +93,6 @@ void MouseCursorController::move(float deltaX, float deltaY) {
    setPositionLocked(mLocked.pointerX + deltaX, mLocked.pointerY + deltaY);
}

void MouseCursorController::setButtonState(int32_t buttonState) {
#if DEBUG_MOUSE_CURSOR_UPDATES
    ALOGD("Set button state 0x%08x", buttonState);
#endif
    std::scoped_lock lock(mLock);

    if (mLocked.buttonState != buttonState) {
        mLocked.buttonState = buttonState;
    }
}

int32_t MouseCursorController::getButtonState() const {
    std::scoped_lock lock(mLock);
    return mLocked.buttonState;
}

void MouseCursorController::setPosition(float x, float y) {
#if DEBUG_MOUSE_CURSOR_UPDATES
    ALOGD("Set pointer position to x=%0.3f, y=%0.3f", x, y);
+0 −4
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ public:

    std::optional<FloatRect> getBounds() const;
    void move(float deltaX, float deltaY);
    void setButtonState(int32_t buttonState);
    int32_t getButtonState() const;
    void setPosition(float x, float y);
    FloatPoint getPosition() const;
    int32_t getDisplayId() const;
@@ -96,8 +94,6 @@ private:
        PointerIconStyle requestedPointerType;
        PointerIconStyle resolvedPointerType;

        int32_t buttonState;

        bool animating{false};

    } mLocked GUARDED_BY(mLock);
+0 −8
Original line number Diff line number Diff line
@@ -136,14 +136,6 @@ void PointerController::move(float deltaX, float deltaY) {
    mCursorController.move(transformed.x, transformed.y);
}

void PointerController::setButtonState(int32_t buttonState) {
    mCursorController.setButtonState(buttonState);
}

int32_t PointerController::getButtonState() const {
    return mCursorController.getButtonState();
}

void PointerController::setPosition(float x, float y) {
    const int32_t displayId = mCursorController.getDisplayId();
    vec2 transformed;
+13 −15
Original line number Diff line number Diff line
@@ -50,21 +50,19 @@ public:

    ~PointerController() override;

    virtual std::optional<FloatRect> getBounds() const;
    virtual void move(float deltaX, float deltaY);
    virtual void setButtonState(int32_t buttonState);
    virtual int32_t getButtonState() const;
    virtual void setPosition(float x, float y);
    virtual FloatPoint getPosition() const;
    virtual int32_t getDisplayId() const;
    virtual void fade(Transition transition);
    virtual void unfade(Transition transition);
    virtual void setDisplayViewport(const DisplayViewport& viewport);

    virtual void setPresentation(Presentation presentation);
    virtual void setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex,
                          BitSet32 spotIdBits, int32_t displayId);
    virtual void clearSpots();
    std::optional<FloatRect> getBounds() const override;
    void move(float deltaX, float deltaY) override;
    void setPosition(float x, float y) override;
    FloatPoint getPosition() const override;
    int32_t getDisplayId() const override;
    void fade(Transition transition) override;
    void unfade(Transition transition) override;
    void setDisplayViewport(const DisplayViewport& viewport) override;

    void setPresentation(Presentation presentation) override;
    void setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex,
                  BitSet32 spotIdBits, int32_t displayId) override;
    void clearSpots() override;

    void updatePointerIcon(PointerIconStyle iconId);
    void setCustomPointerIcon(const SpriteIcon& icon);