diff options
| author | 2023-11-10 15:48:19 +0000 | |
|---|---|---|
| committer | 2023-11-10 15:48:19 +0000 | |
| commit | 4677cb3107d04d9c08099c416cf98ef7dfc8862c (patch) | |
| tree | 0c01a9bfa1f4c0fd8bc9ce2f6905dd5769bd79bc /libs/input/PointerController.h | |
| parent | 0fab28563a722e7aa1f60aab904b5ca906071ed7 (diff) | |
| parent | b0e280722c6e876c1d23dd8d0140e33a4e846cd9 (diff) | |
Merge changes from topics "pointer-icon-refactor-comments", "pointer-icon-refactor-stylus", "pointer-icon-refactor-touch" into main
* changes:
Address additional comments: Pointer icon refactor for touch/stylus
Modify getPosition of disabled PointerController
Pointer icon refactor for stylus (base)
Pointer icon refactor for touch (base)
Diffstat (limited to 'libs/input/PointerController.h')
| -rw-r--r-- | libs/input/PointerController.h | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h index 08e19a096d87..fa07c3989720 100644 --- a/libs/input/PointerController.h +++ b/libs/input/PointerController.h @@ -68,7 +68,7 @@ public: void updatePointerIcon(PointerIconStyle iconId); void setCustomPointerIcon(const SpriteIcon& icon); - void setInactivityTimeout(InactivityTimeout inactivityTimeout); + virtual void setInactivityTimeout(InactivityTimeout inactivityTimeout); void doInactivityTimeout(); void reloadPointerResources(); void onDisplayViewportsUpdated(const std::vector<DisplayViewport>& viewports); @@ -143,6 +143,74 @@ public: const sp<Looper>& looper, SpriteController& spriteController, bool enabled); + ~MousePointerController() override; + + void setPresentation(Presentation) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void setSpots(const PointerCoords*, const uint32_t*, BitSet32, int32_t) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void clearSpots() override { + LOG_ALWAYS_FATAL("Should not be called"); + } +}; + +class TouchPointerController : public PointerController { +public: + /** A version of PointerController that controls touch spots. */ + TouchPointerController(const sp<PointerControllerPolicyInterface>& policy, + const sp<Looper>& looper, SpriteController& spriteController, + bool enabled); + + ~TouchPointerController() override; + + std::optional<FloatRect> getBounds() const override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void move(float, float) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void setPosition(float, float) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + FloatPoint getPosition() const override { + LOG_ALWAYS_FATAL("Should not be called"); + } + int32_t getDisplayId() const override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void fade(Transition) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void unfade(Transition) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void setDisplayViewport(const DisplayViewport&) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void setPresentation(Presentation) override { + LOG_ALWAYS_FATAL("Should not be called"); + } + void updatePointerIcon(PointerIconStyle) { + LOG_ALWAYS_FATAL("Should not be called"); + } + void setCustomPointerIcon(const SpriteIcon&) { + LOG_ALWAYS_FATAL("Should not be called"); + } + // fade() should not be called by inactivity timeout. Do nothing. + void setInactivityTimeout(InactivityTimeout) override {} +}; + +class StylusPointerController : public PointerController { +public: + /** A version of PointerController that controls one stylus pointer. */ + StylusPointerController(const sp<PointerControllerPolicyInterface>& policy, + const sp<Looper>& looper, SpriteController& spriteController, + bool enabled); + + ~StylusPointerController() override; + void setPresentation(Presentation) override { LOG_ALWAYS_FATAL("Should not be called"); } |